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
366 Info<<
"Writing merged surface to " << globalCasePath <<
endl;
368 sortedFace.
write(globalCasePath);
A surface geometry mesh, in which the surface zone information is conveyed by the 'zoneId' associated...
#define forAll(list, i)
Loop across all elements in list.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
autoPtr< globalIndex > mergePoints(labelList &pointToGlobal, labelList &uniquePoints) const
Helper for merging (collocated!) mesh point data.
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.
label index() const
Return the index of this zone in zone list.
bool empty() const
Return true if the UList is empty (ie, size() is zero)
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.
static bool master(const label communicator=0)
Am I the master process.
static SLList< string > validArgs
A list of valid (mandatory) arguments.
bool insert(const Key &key)
Insert a new entry.
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
virtual const pointField & points() const
Return raw points.
bool findStrings(const wordReListMatcher &matcher, const std::string &str)
Return true if string matches one of the regular expressions.
static void mapCombineScatter(const List< commsStruct > &comms, Container &Values, const int tag, const label comm)
Scatter data. Reverse of combineGather.
const word & name() const
Return name.
A list of faces which address into the list of points.
label findZoneID(const word &zoneName) const
Find zone index given a name.
vectorField pointField
pointField is a vectorField.
label start() const
Return start label of this patch in the polyMesh face list.
bool optionFound(const word &opt) const
Return true if the named option is found.
Xfer< T > xferMove(T &)
Construct by transferring the contents of the arg.
wordList names() const
Return a list of zone names.
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.
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.
static void mapCombineGather(const List< commsStruct > &comms, Container &Values, const CombineOp &cop, const int tag, const label comm)
const word & name() const
Return name.
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
A wordRe is a word, but can also have a regular expression for matching words.
const globalMeshData & globalData() const
Return parallel info.
labelHashSet includePatches
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.
IStringStream optionLookup(const word &opt) const
Return an IStringStream from the named option.
const faceZoneMesh & faceZones() const
Return face zone mesh.
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.
virtual const faceList & faces() const
Return raw faces.
Foam::argList args(argc, argv)
label findPatchID(const word &patchName) const
Find patch index given a name.
static void gatherList(const List< commsStruct > &comms, List< T > &Values, const int tag, const label comm)
Gather data but keep individual values separate.
label index() const
Return the index of this patch in the boundaryMesh.
label size() const
Return the number of elements in the UPtrList.