Go to the documentation of this file.
65 void Foam::ensightMesh::clear()
67 cellZoneParts_.clear();
68 faceZoneParts_.clear();
69 boundaryParts_.clear();
73 void Foam::ensightMesh::renumber()
77 for (
const label
id : cellZoneParts_.sortedToc())
79 cellZoneParts_[id].index() = partNo++;
82 for (
const label
id : boundaryParts_.sortedToc())
84 boundaryParts_[id].index() = partNo++;
87 for (
const label
id : faceZoneParts_.sortedToc())
89 faceZoneParts_[id].index() = partNo++;
96 Foam::ensightMesh::ensightMesh
105 Foam::ensightMesh::ensightMesh
115 if (!option().lazy())
128 const wordRes& czMatcher = option().cellZoneSelection();
129 const wordRes& fzMatcher = option().faceZoneSelection();
135 option().useCellZones()
136 && (!czMatcher.empty() || option().useInternalMesh())
138 ? mesh_.cellZones().names()
153 option().useFaceZones()
154 ? mesh_.faceZones().names()
169 option().useBoundaryMesh()
176 option().useBoundaryMesh()
180 option().patchSelection(),
181 option().patchExclude()
195 for (
const label zoneId : czoneIds)
197 const word& zoneName = czNames[zoneId];
198 const cellZone& zn = mesh_.cellZones()[zoneId];
203 cellSelection.
resize(mesh_.nCells());
205 cellSelection.
set(zn);
220 if (option().useInternalMesh() && czMatcher.empty())
226 if (cellZoneParts_.empty())
232 part.
rename(
"internalMesh");
242 cellSelection.
flip();
250 part.
rename(
"internalMesh");
252 part.
classify(mesh_, cellSelection);
262 else if (cellSelection.
none())
274 excludeFace.
resize(mesh_.nFaces());
276 const labelList& owner = mesh_.faceOwner();
280 const label celli = owner[facei];
282 if (!cellSelection.
test(celli))
284 excludeFace.
set(facei);
296 excludeFace.
resize(mesh_.nFaces());
298 for (
const polyPatch&
p : mesh_.boundaryMesh())
300 const auto* procPatch = isA<processorPolyPatch>(
p);
302 if (isA<emptyPolyPatch>(
p))
304 excludeFace.
set(
p.range());
306 else if (procPatch && !procPatch->owner())
309 excludeFace.
set(
p.range());
321 if (isA<emptyPolyPatch>(
p))
326 else if (isA<processorPolyPatch>(
p))
358 for (
const label zoneId : fzoneIds)
360 const word& zoneName = fzNames[zoneId];
361 const faceZone& zn = mesh_.faceZones()[zoneId];
385 faceZoneParts_.erase(zoneId);
391 needsUpdate_ =
false;
402 for (
const label
id : cellZoneParts_.sortedToc())
404 cellZoneParts_[id].write(
os, mesh_, parallel);
408 for (
const label
id : boundaryParts_.sortedToc())
410 boundaryParts_[id].write(
os, mesh_, parallel);
414 for (
const label
id : faceZoneParts_.sortedToc())
416 faceZoneParts_[id].write(
os, mesh_, parallel);
List< label > labelList
A List of labels.
void resize(const label numElem, const unsigned int val=0u)
Reset addressable list size, does not shrink the allocated size.
labelList matching(const UList< StringType > &input, const bool invert=false) const
Return list indices for all matches.
Encapsulation of volume meshes for writing in ensight format. It manages cellZones,...
A class for handling words, derived from Foam::string.
const boolList & flipMap() const noexcept
Return face flip map.
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
void rename(const string &value)
Change the part name or description.
void resize(const label len)
Adjust allocated size of list.
A polyBoundaryMesh is a polyPatch list with additional search methods and registered IO.
void correct()
Update for new mesh.
bool any() const
True if any bits in this bitset are set.
void set(const bitSet &bitset)
Set specified bits from another bitset.
List< bool > boolList
A List of bools.
bool empty() const noexcept
True if the list is empty (ie, size() is zero).
bool test(const label pos) const
Test value at specified position, never auto-vivify entries.
void write(ensightGeoFile &os, bool parallel=Pstream::parRun()) const
Write geometry to file. Normally in parallel.
Sorting/classification of faces (2D) into corresponding ensight types.
Mesh consisting of general polyhedral cells.
wordList names() const
Return a list of patch names.
static const label internalZone
The zone-id for internal mesh or unzoned cells.
#define forAll(list, i)
Loop across all elements in list.
label total() const
The global size of all element types.
List< word > wordList
A List of words.
Specialized Ensight output with extra geometry file header.
bool checkParallelSync(const bool report=false) const
Check whether all procs have all patches and in same order. Return.
A subset of mesh faces organised as a primitive patch.
void reduce()
Sum element counts across all processes.
A patch is a list of labels that address the faces in the global face list.
wordList patchNames(nPatches)
labelList findMatching(const StringListType &input, const wordRes &allow, const wordRes &deny=wordRes(), AccessOp aop=noOp())
Return ids for items with matching names.
Sorting/classification of cells (3D) into corresponding ensight element types.
void flip()
Invert all bits in the addressable region.
OBJstream os(runTime.globalPath()/outputName)
label nNonProcessor() const
The number of patches before the first processor patch.
bool none() const
True if no bits in this bitset are set.
IntListType renumber(const labelUList &oldToNew, const IntListType &input)
Renumber the values (not the indices) of a list.
Configuration options for the ensightMesh.
void clear()
Set addressable sizes to zero, free up addressing memory.
labelList identity(const label len, label start=0)
Create identity map of the given length with (map[i] == i)
A List of wordRe with additional matching capabilities.
void clearStorage()
Clear the list and delete storage.
label identifier() const noexcept
OpenFOAM identifier (patch, zone, etc), -1 when not in use.
void classify(const polyMesh &mesh)
Classify cell types and set the element lists.
void reduce()
Sum element counts across all processes.
void clear()
Set addressable sizes to zero, free up addressing memory.
void classify(const UList< face > &faces)
Classify the face types and set the element lists.
static wordList nonProcessorPatchNames(const polyBoundaryMesh &bmesh)