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
111 options_(new options(opts)),
143 const wordRes& czMatcher = option().cellZoneSelection();
144 const wordRes& fzMatcher = option().faceZoneSelection();
150 option().useCellZones()
151 && (!czMatcher.
empty() || option().useInternalMesh())
153 ? mesh_.cellZones().names()
168 option().useFaceZones()
169 ? mesh_.faceZones().names()
184 option().useBoundaryMesh()
191 option().useBoundaryMesh()
195 option().patchSelection(),
196 option().patchExclude()
210 for (
const label zoneId : czoneIds)
212 const word& zoneName = czNames[zoneId];
213 const cellZone& zn = mesh_.cellZones()[zoneId];
218 cellSelection.
resize(mesh_.nCells());
220 cellSelection.
set(zn);
239 if (option().useInternalMesh() && czMatcher.
empty())
245 if (cellZoneParts_.empty())
247 ensightCells& part = cellZoneParts_(internalZone);
250 part.identifier() = internalZone;
251 part.rename(
"internalMesh");
253 part.classify(mesh_);
265 cellSelection.
flip();
269 ensightCells& part = cellZoneParts_(internalZone);
272 part.identifier() = internalZone;
273 part.rename(
"internalMesh");
275 part.classify(mesh_, cellSelection);
289 else if (cellSelection.
none())
301 excludeFace.
resize(mesh_.nFaces());
303 const labelList& owner = mesh_.faceOwner();
307 const label celli = owner[facei];
309 if (!cellSelection.
test(celli))
311 excludeFace.
set(facei);
323 excludeFace.
resize(mesh_.nFaces());
325 for (
const polyPatch&
p : mesh_.boundaryMesh())
327 const auto* cpp = isA<coupledPolyPatch>(
p);
331 isA<emptyPolyPatch>(
p)
332 || (cpp && !cpp->owner())
337 excludeFace.
set(
p.range());
347 const polyPatch&
p = mesh_.boundaryMesh()[
patchId];
349 if (isA<emptyPolyPatch>(
p))
354 else if (isA<processorPolyPatch>(
p))
360 ensightFaces& part = boundaryParts_(
patchId);
364 part.rename(patchName);
389 for (
const label zoneId : fzoneIds)
391 const word& zoneName = fzNames[zoneId];
392 const faceZone& zn = mesh_.faceZones()[zoneId];
394 ensightFaces& part = faceZoneParts_(zoneId);
397 part.identifier() = zoneId;
398 part.rename(zoneName);
419 faceZoneParts_.erase(zoneId);
425 needsUpdate_ =
false;
436 for (
const label
id : cellZoneParts_.sortedToc())
438 cellZoneParts_[id].write(
os, mesh_, parallel);
442 for (
const label
id : boundaryParts_.sortedToc())
444 boundaryParts_[id].write(
os, mesh_, parallel);
448 for (
const label
id : faceZoneParts_.sortedToc())
450 faceZoneParts_[id].write(
os, mesh_, parallel);
void classify(const polyMesh &mesh)
Classify cell types and set the element lists.
void size(const label n)
Older name for setAddressableSize.
void set(const bitSet &bitset)
Set specified bits from another bitset.
void write(ensightGeoFile &os, bool parallel=Pstream::parRun()) const
Write geometry to file. Normally in parallel.
labelList matching(const UList< StringType > &input, const bool invert=false) const
Return list indices for all matches.
void resize(const label len)
Adjust allocated size of list.
const ensightMesh::options & option() const
Reference to the writer/mesh options.
InfoProxy< ensightCells > info() const noexcept
Return info proxy, used to print information to a stream.
IntListType renumber(const labelUList &oldToNew, const IntListType &input)
Renumber the values (not the indices) of a list.
void flip()
Invert all bits in the addressable region.
bool empty() const noexcept
True if List is empty (ie, size() is zero)
Specialized Ensight output with extra geometry file header.
bool any() const
True if any bits in this bitset are set.
void resize(const label numElem, const unsigned int val=0u)
Reset addressable list size, does not shrink the allocated size.
#define forAll(list, i)
Loop across all elements in list.
void correct()
Update for new mesh.
static wordList nonProcessorPatchNames(const polyBoundaryMesh &bmesh)
label identifier() const noexcept
OpenFOAM identifier (patch, zone, etc), -1 when not in use.
labelList identity(const label len, label start=0)
Return an identity map of the given length with (map[i] == i), works like std::iota() but returning a...
A class for handling words, derived from Foam::string.
Sorting/classification of cells (3D) into corresponding ensight element types.
wordList names() const
Return a list of patch names.
wordList patchNames(nPatches)
labelList findMatching(const StringListType &input, const wordRes::filter &pred, AccessOp aop=identityOp())
Return ids for items with matching names.
A List of wordRe with additional matching capabilities.
bool test(const label pos) const
Test for True value at specified position, never auto-vivify entries.
void reduce()
Sum element counts across all processes.
A polyBoundaryMesh is a polyPatch list with additional search methods and registered IO...
bool checkParallelSync(const bool report=false) const
Check whether all procs have all patches and in same order.
void clear()
Set addressable sizes to zero, free up addressing memory.
Encapsulation of volume meshes for writing in ensight format. It manages cellZones, facesZone, patches.
OBJstream os(runTime.globalPath()/outputName)
List< word > wordList
List of word.
bool empty() const noexcept
True if the list is empty (ie, size() is zero).
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
messageStream Info
Information stream (stdout output on master, null elsewhere)
static const label internalZone
The zone-id for internal mesh or unzoned cells.
Configuration options for the ensightMesh.
void clearStorage()
Clear the list and delete storage.
Mesh consisting of general polyhedral cells.
int verbose() const noexcept
Output verbosity level.
List< label > labelList
A List of labels.
label nNonProcessor() const
The number of patches before the first processor patch.
bool returnReduceOr(const bool value, const label comm=UPstream::worldComm)
Perform logical (or) MPI Allreduce on a copy. Uses UPstream::reduceOr.
List< bool > boolList
A List of bools.
bool none() const
True if no bits in this bitset are set.
void rename(const string &value)
Change the part name or description.