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];
202 cellSelection.
set(zn);
217 if (option().useInternalMesh() && czMatcher.empty())
223 if (cellZoneParts_.empty())
229 part.
rename(
"internalMesh");
239 cellSelection.
flip();
247 part.
rename(
"internalMesh");
249 part.
classify(mesh_, cellSelection);
259 else if (cellSelection.
none())
270 excludeFace.
resize(mesh_.nFaces());
272 const labelList& owner = mesh_.faceOwner();
276 const label celli = owner[facei];
278 if (!cellSelection.
test(celli))
280 excludeFace.
set(facei);
291 excludeFace.
resize(mesh_.nFaces());
293 for (
const polyPatch&
p : mesh_.boundaryMesh())
295 const auto* procPatch = isA<processorPolyPatch>(
p);
297 if (isA<emptyPolyPatch>(
p))
299 excludeFace.
set(
p.range());
301 else if (procPatch && !procPatch->owner())
304 excludeFace.
set(
p.range());
316 if (isA<emptyPolyPatch>(
p))
321 else if (isA<processorPolyPatch>(
p))
353 for (
const label zoneId : fzoneIds)
355 const word& zoneName = fzNames[zoneId];
356 const faceZone& zn = mesh_.faceZones()[zoneId];
380 faceZoneParts_.erase(zoneId);
386 needsUpdate_ =
false;
397 for (
const label
id : cellZoneParts_.sortedToc())
399 cellZoneParts_[id].write(os, mesh_, parallel);
403 for (
const label
id : boundaryParts_.sortedToc())
405 boundaryParts_[id].write(os, mesh_, parallel);
409 for (
const label
id : faceZoneParts_.sortedToc())
411 faceZoneParts_[id].write(os, mesh_, parallel);
List< label > labelList
A List of labels.
labelList matching(const UList< StringType > &input, const bool invert=false) const
Extract 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.
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.
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 resize(const label nElem, const unsigned int val=0u)
Reset addressable list size, does not shrink the allocated size.
void write(autoPtr< 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.
label identifier() const
OpenFOAM identifier (patch, zone, etc), -1 when not in use.
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 resize(const label newSize)
Adjust allocated size of list.
void flip()
Invert all bits in the addressable region.
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.
void classify(const polyMesh &mesh)
Classify cell types and set the element lists.
const boolList & flipMap() const
Return face flip map.
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)