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()];
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 label fzi = iter.key();
267 compactZones.
append(faceZoneToCompactZone[fzi]);
286 allBoundary.meshPoints(),
287 allBoundary.meshPointMap(),
318 pointField allPoints = ListListOps::combine<pointField>
323 gatheredPoints.clear();
325 faceList allFaces = ListListOps::combine<faceList>
330 gatheredFaces.clear();
332 labelList allZones = ListListOps::combine<labelList>
337 gatheredZones.clear();
345 Info<<
"surfZone " << iter() <<
" : " << surfZones[iter()].name()
360 Info<<
"Writing merged surface to "
361 << runTime.globalPath()/outFileName <<
endl;
363 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 >> &zonesIndices)
Insert given indices and corresponding face flips into zones.
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.
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 set of patch indices corresponding to the given names.
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.
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)