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.value() <<
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 = fzm[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 = fzm[iter.key()];
266 compactZones.
append(faceZoneToCompactZone[pp.
index()]);
285 allBoundary.meshPoints(),
286 allBoundary.meshPointMap(),
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()
361 runTime.processorCase()
362 ? runTime.path()/
".."/outFileName
363 : runTime.path()/outFileName
365 globalCasePath.
clean();
367 Info<<
"Writing merged surface to " << globalCasePath <<
endl;
369 sortedFace.
write(globalCasePath);
A surface geometry mesh, in which the surface zone information is conveyed by the 'zoneId' associated...
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
#define forAll(list, i)
Loop across all elements in list.
bool empty() const
Return true if the UList is empty (ie, size() is zero)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
const word & name() const
Return name.
A class for handling file names.
An identifier for a surface zone on a meshed surface.
void inplaceRenumber(const labelUList &oldToNew, ListType &)
Inplace renumber the values of a list.
const faceZoneMesh & faceZones() const
Return face zone mesh.
bool clean()
Cleanup file name.
void size(const label)
Override size to be inconsistent with allocated storage.
static int myProcNo(const label communicator=0)
Number of this process (starting from masterNo() = 0)
Ostream & endl(Ostream &os)
Add newline and flush stream.
bool optionFound(const word &opt) const
Return true if the named option is found.
static bool master(const label communicator=0)
Am I the master process.
label findPatchID(const word &patchName) const
Find patch index given a name.
static SLList< string > validArgs
A list of valid (mandatory) arguments.
autoPtr< globalIndex > mergePoints(labelList &pointToGlobal, labelList &uniquePoints) const
Helper for merging (collocated!) mesh point data.
bool insert(const Key &key)
Insert a new entry.
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.
bool findStrings(const wordReListMatcher &matcher, const std::string &str)
Return true if string matches one of the regular expressions.
virtual const pointField & points() const
Return raw points.
static void mapCombineScatter(const List< commsStruct > &comms, Container &Values, const int tag, const label comm)
Scatter data. Reverse of combineGather.
label index() const
Return the index of this zone in zone list.
A list of faces which address into the list of points.
vectorField pointField
pointField is a vectorField.
label findZoneID(const word &zoneName) const
Find zone index given a name.
Xfer< T > xferMove(T &)
Construct by transferring the contents of the arg.
void setCapacity(const label)
Alter the size of the underlying storage.
Xfer< List< T > > xfer()
Transfer contents to the Xfer container as a plain List.
static void addOption(const word &opt, const string ¶m="", const string &usage="")
Add to an option to validOptions with usage information.
DynamicList< T, SizeInc, SizeMult, SizeDiv > & append(const T &)
Append an element at the end of the list.
const globalMeshData & globalData() const
Return parallel info.
const word & name() const
Return name.
static void mapCombineGather(const List< commsStruct > &comms, Container &Values, const CombineOp &cop, const int tag, const label comm)
virtual const faceList & faces() const
Return raw faces.
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
A wordRe is a word, but can also have a regular expression for matching words.
labelHashSet includePatches
label size() const
Return the number of elements in the UPtrList.
static bool & parRun()
Is this a parallel run?
static label nProcs(const label communicator=0)
Number of processes in parallel run.
#define WarningInFunction
Report a warning using Foam::Warning.
A List with indirect addressing.
label index() const
Return the index of this patch in the boundaryMesh.
label start() const
Return start label of this patch in the polyMesh face list.
wordList names() const
Return a list of zone names.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
virtual Ostream & write(const token &)=0
Write next token to stream.
static void addBoolOption(const word &opt, const string &usage="")
Add to a bool option to validOptions with usage information.
A subset of mesh faces organised as a primitive patch.
List< wordRe > wordReList
A List of wordRe (word or regular expression)
static void addNote(const string &)
Add extra notes for the usage information.
A patch is a list of labels that address the faces in the global face list.
Foam::argList args(argc, argv)
static void gatherList(const List< commsStruct > &comms, List< T > &Values, const int tag, const label comm)
Gather data but keep individual values separate.
IStringStream optionLookup(const word &opt) const
Return an IStringStream from the named option.