57 int main(
int argc,
char *argv[])
61 "extract surface from a polyMesh"
68 "exclude processor patches"
74 "only triangulate selected patches (wildcards supported)"
80 "triangulate selected faceZones (wildcards supported)"
88 Info<<
"Extracting surface from boundaryMesh ..."
91 const bool includeProcPatches =
97 if (includeProcPatches)
99 Info<<
"Including all processor patches." <<
nl <<
endl;
103 Info<<
"Excluding all processor patches." <<
nl <<
endl;
106 Info<<
"Reading mesh from time " << runTime.userTimeName() <<
endl;
136 if (includeProcPatches || !isA<processorPolyPatch>(patch))
154 const wordRe& zoneName = zoneNames[i];
160 includeFaceZones.insert(zoneIDs[j]);
166 <<
"Cannot find any faceZone name matching "
171 Info<<
"Additionally triangulating faceZones "
192 patchSize.insert(pp.
name(), pp.size());
199 const faceZone& pp = mfz[iter.key()];
200 zoneSize.insert(pp.
name(), pp.
size());
212 label sz = compactZoneID.size();
213 compactZoneID.insert(iter.key(), sz);
218 label sz = compactZoneID.size();
221 compactZoneID.insert(iter.key(), sz);
236 patchToCompactZone[
patchi] = iter();
241 faceZoneToCompactZone[zoneI] = iter();
256 compactZones.
append(patchToCompactZone[pp.
index()]);
262 const faceZone& pp = mfz[iter.key()];
266 compactZones.
append(faceZoneToCompactZone[pp.
index()]);
285 allBoundary.meshPoints(),
286 allBoundary.meshPointMap(),
317 pointField allPoints = ListListOps::combine<pointField>
322 gatheredPoints.clear();
324 faceList allFaces = ListListOps::combine<faceList>
329 gatheredFaces.clear();
331 labelList allZones = ListListOps::combine<labelList>
336 gatheredZones.clear();
344 Info<<
"surfZone " << iter() <<
" : " << surfZones[iter()].name()
359 Info<<
"Writing merged surface to "
360 << runTime.globalPath()/outFileName <<
endl;
362 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.
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.
label findZoneID(const word &zoneName) const
Find zone index given a name.
wordList names() const
Return a list of zone names.
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.
A List with indirect addressing.
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...
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...
A subset of mesh faces organised as a primitive patch.
A class for handling file names.
label index() const
Return the index of this patch in the boundaryMesh.
const word & name() const
Return name.
labelHashSet patchSet(const UList< wordRe > &patchNames, const bool warnNotFound=true, const bool usePatchGroups=true) const
Return the set of patch IDs corresponding to the given names.
label findPatchID(const word &patchName) const
Find patch index given a name.
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.
label index() const
Return the index of this zone in zone list.
const word & name() const
Return name.
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)