57 int main(
int argc,
char *argv[])
61 "extract surface from a polyMesh"
69 "exclude processor patches"
75 "only triangulate selected patches (wildcards supported)"
81 "triangulate selected faceZones (wildcards supported)"
89 Info<<
"Extracting surface from boundaryMesh ..."
92 const bool includeProcPatches =
98 if (includeProcPatches)
100 Info<<
"Including all processor patches." <<
nl <<
endl;
104 Info<<
"Excluding all processor patches." <<
nl <<
endl;
107 Info<<
"Reading mesh from time " << runTime.userTimeName() <<
endl;
137 if (includeProcPatches || !isA<processorPolyPatch>(patch))
155 const wordRe& zoneName = zoneNames[i];
161 includeFaceZones.insert(zoneIDs[j]);
167 <<
"Cannot find any faceZone name matching "
172 Info<<
"Additionally triangulating faceZones "
193 patchSize.insert(pp.
name(), pp.
size());
200 const faceZone& pp = mfz[iter.key()];
213 label sz = compactZoneID.size();
214 compactZoneID.insert(iter.key(), sz);
219 label sz = compactZoneID.size();
222 compactZoneID.insert(iter.key(), sz);
237 patchToCompactZone[
patchi] = iter();
242 faceZoneToCompactZone[zoneI] = iter();
257 compactZones.
append(patchToCompactZone[pp.
index()]);
263 const label fzi = iter.key();
268 compactZones.
append(faceZoneToCompactZone[fzi]);
287 allBoundary.meshPoints(),
288 allBoundary.meshPointMap(),
319 pointField allPoints = ListListOps::combine<pointField>
324 gatheredPoints.clear();
326 faceList allFaces = ListListOps::combine<faceList>
331 gatheredFaces.clear();
333 labelList allZones = ListListOps::combine<labelList>
338 gatheredZones.clear();
346 Info<<
"surfZone " << iter() <<
" : " << surfZones[iter()].name()
361 Info<<
"Writing merged surface to "
362 << runTime.globalPath()/outFileName <<
endl;
364 sortedFace.
write(runTime.globalPath()/outFileName);
#define forAll(list, i)
Loop across all elements in list.
#define forAllConstIter(Container, container, iter)
Iterate across all elements in the container object of type.
wordList toc() const
Return the table of contents.
void setCapacity(const label)
Alter the size of the underlying storage.
DynamicList< T, SizeInc, SizeMult, SizeDiv > & append(const T &)
Append an element at the end of the list.
bool insert(const Key &key)
Insert a new entry.
void size(const label)
Override size to be inconsistent with allocated storage.
virtual Ostream & write(const char)=0
Write character.
A list of faces which address into the list of points.
static void mapCombineScatter(const List< commsStruct > &comms, Container &Values, const int tag, const label comm)
Scatter data. Reverse of combineGather.
static void mapCombineGather(const List< commsStruct > &comms, Container &Values, const CombineOp &cop, const int tag, const label comm)
static void gatherList(const List< commsStruct > &comms, List< T > &Values, const int tag, const label comm)
Gather data but keep individual values separate.
label findIndex(const word &key) const
Return the index of the given the key or -1 if not found.
A List with indirect addressing.
label size() const
Return the number of elements in the UList.
bool empty() const
Return true if the UList is empty (ie, size() is zero)
static bool master(const label communicator=0)
Am I the master process.
static label nProcs(const label communicator=0)
Number of processes in parallel run.
static bool & parRun()
Is this a parallel run?
static int myProcNo(const label communicator=0)
Number of this process (starting from masterNo() = 0)
label size() const
Return the number of elements in the UPtrList.
A surface geometry mesh, in which the surface zone information is conveyed by the 'zoneId' associated...
const word & name() const
Return name.
static void addOption(const word &opt, const string ¶m="", const string &usage="")
Add to an option to validOptions with usage information.
static void addNote(const string &)
Add extra notes for the usage information.
static void addBoolOption(const word &opt, const string &usage="")
Add to a bool option to validOptions with usage information.
bool optionFound(const word &opt) const
Return true if the named option is found.
static SLList< string > validArgs
A list of valid (mandatory) arguments.
IStringStream optionLookup(const word &opt) const
Return an IStringStream from the named option.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
void insert(const List< Map< bool >> &zonesOrientedIndices)
Insert given oriented indices.
Named list of face indices representing a sub-set of the mesh faces.
A class for handling file names.
autoPtr< globalIndex > mergePoints(labelList &pointToGlobal, labelList &uniquePoints) const
Helper for merging (collocated!) mesh point data.
label index() const
Return the index of this patch in the boundaryMesh.
const word & name() const
Return name.
label findIndex(const word &patchName) const
Find patch index given a name.
labelHashSet patchSet(const UList< wordRe > &patchNames, const bool warnNotFound=true, const bool usePatchGroups=true) const
Return the patch set corresponding to the given names.
virtual const faceList & faces() const
Return raw faces.
const globalMeshData & globalData() const
Return parallel info.
const faceZoneList & faceZones() const
Return face zones.
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
virtual const pointField & points() const
Return raw points.
A patch is a list of labels that address the faces in the global face list.
label start() const
Return start label of this patch in the polyMesh face list.
An identifier for a surface zone on a meshed surface.
A wordRe is a word, but can also have a regular expression for matching words.
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
int main(int argc, char *argv[])
const polyBoundaryMesh & bMesh
#define WarningInFunction
Report a warning using Foam::Warning.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
bool findStrings(const wordReListMatcher &matcher, const std::string &str)
Return true if string matches one of the regular expressions.
Ostream & endl(Ostream &os)
Add newline and flush stream.
vectorField pointField
pointField is a vectorField.
void inplaceRenumber(const labelUList &oldToNew, ListType &)
Inplace renumber the values of a list.
List< wordRe > wordReList
A List of wordRe (word or regular expression)
labelHashSet includePatches
Foam::argList args(argc, argv)