A list of mesh zones. More...
Public Member Functions | |
ZoneMesh (const IOobject &io, const MeshType &mesh) | |
Read constructor given IOobject and a MeshType reference. More... | |
ZoneMesh (const IOobject &io, const MeshType &mesh, const label size) | |
Construct given size. More... | |
ZoneMesh (const IOobject &io, const MeshType &mesh, const PtrList< ZoneType > &pzm) | |
Construct given a PtrList. More... | |
~ZoneMesh () | |
Destructor. More... | |
const MeshType & | mesh () const noexcept |
Return the mesh reference. More... | |
const Map< label > & | zoneMap () const |
Map of zones containing zone index for all zoned elements. More... | |
label | whichZone (const label objectIndex) const |
Given a global object index, return the zone it is in. More... | |
wordList | types () const |
Return a list of zone types. More... | |
wordList | names () const |
A list of the zone names. More... | |
wordList | names (const wordRe &matcher) const |
A list of zone names satisfying the input matcher. More... | |
wordList | names (const wordRes &matcher) const |
A list of zone names satisfying the input matchers. More... | |
wordList | sortedNames () const |
Sorted list of the zone names. More... | |
wordList | sortedNames (const wordRe &matcher) const |
Sorted list of zone names satisfying the input matcher. More... | |
wordList | sortedNames (const wordRes &matcher) const |
Sorted list of zone names satisfying the input matchers. More... | |
labelList | indices (const wordRe &matcher, const bool useGroups=true) const |
Return (sorted) zone indices for all matches. More... | |
labelList | indices (const wordRes &matcher, const bool useGroups=true) const |
Return (sorted) zone indices for all matches. More... | |
label | findIndex (const wordRe &key) const |
Zone index for the first match, return -1 if not found. More... | |
label | findIndex (const wordRes &matcher) const |
Zone index for the first match, return -1 if not found. More... | |
label | findZoneID (const word &zoneName) const |
Find zone index by name, return -1 if not found. More... | |
const ZoneType * | cfindZone (const word &zoneName) const |
Find zone by name and return const pointer, nullptr on error. More... | |
ZoneType * | findZone (const word &zoneName) |
Find zone by name and return pointer, nullptr on error. More... | |
bitSet | selection (const labelUList &zoneIds) const |
bitSet | selection (const wordRe &matcher, const bool useGroups=true) const |
bitSet | selection (const wordRes &matcher, const bool useGroups=true) const |
const HashTable< labelList > & | groupZoneIDs () const |
The zone indices per zone group. More... | |
void | setGroup (const word &groupName, const labelUList &zoneIDs) |
Set/add group with zones. More... | |
bool | checkDefinition (const bool report=false) const |
Check zone definition. Return true if in error. More... | |
bool | checkParallelSync (const bool report=false) const |
Check whether all procs have all zones and in same order. More... | |
void | movePoints (const pointField &pts) |
Correct zone mesh after moving points. More... | |
void | clearAddressing () |
Clear addressing. More... | |
void | clear () |
Clear the zones. More... | |
bool | hasFaceAreas () const |
const ZoneType & | operator[] (const word &zoneName) const |
Return const reference to zone by name. More... | |
ZoneType & | operator[] (const word &zoneName) |
Return reference to an existing zone by name. More... | |
ZoneType & | operator() (const word &zoneName, const bool verbose=false) |
void | updateMetaData () |
Update internal meta-data (eg, prior to writing) More... | |
bool | writeData (Ostream &os) const |
The writeData member function required by regIOobject. More... | |
labelList | findIndices (const wordRes &key) const |
Identical to the indices() method (AUG-2018) More... | |
Static Public Attributes | |
static int | disallowGenericZones |
Debug switch to disallow the use of generic zones. More... | |
Friends | |
Ostream & | operator (Ostream &os, const ZoneMesh< ZoneType, MeshType > &zones) |
A list of mesh zones.
Definition at line 44 of file cellZoneMeshFwd.H.
Read constructor given IOobject and a MeshType reference.
Definition at line 207 of file ZoneMesh.C.
Construct given size.
Definition at line 222 of file ZoneMesh.C.
Construct given a PtrList.
Definition at line 239 of file ZoneMesh.C.
~ZoneMesh | ( | ) |
Destructor.
Definition at line 266 of file ZoneMesh.C.
|
inlinenoexcept |
Return the mesh reference.
Definition at line 142 of file ZoneMesh.H.
const Foam::Map< Foam::label > & zoneMap | ( | ) | const |
Map of zones containing zone index for all zoned elements.
Return -1 if the object is not in the zone
Definition at line 276 of file ZoneMesh.C.
Foam::label whichZone | ( | const label | objectIndex | ) | const |
Given a global object index, return the zone it is in.
If object does not belong to any zones, return -1
Definition at line 289 of file ZoneMesh.C.
Referenced by cyclicAMIPolyPatch::addAMIFaces(), meshRefinement::mergeBaffles(), polyMeshAdder::mergePoints(), removeCells::setRefinement(), perfectInterface::setRefinement(), and edgeCollapser::setRefinement().
Foam::wordList types | ( | ) | const |
Return a list of zone types.
Definition at line 298 of file ZoneMesh.C.
Foam::wordList names | ( | ) | const |
A list of the zone names.
Definition at line 305 of file ZoneMesh.C.
Referenced by preserveFaceZones::add(), surfaceZonesInfo::addCellZonesToMesh(), preserveFaceZones::apply(), meshRefinement::checkCoupledFaceZones(), extractEulerianParticles::checkFaceZone(), dynamicMultiMotionSolverFvMesh::init(), fvMeshTools::newMesh(), cellTable::operator=(), multiphaseMangrovesTurbulenceModel::read(), sizeDistribution::setCellZoneCells(), and displacementLayeredMotionMotionSolver::solve().
Foam::wordList names | ( | const wordRe & | matcher | ) | const |
A list of zone names satisfying the input matcher.
Definition at line 313 of file ZoneMesh.C.
Foam::wordList names | ( | const wordRes & | matcher | ) | const |
A list of zone names satisfying the input matchers.
Definition at line 323 of file ZoneMesh.C.
Foam::wordList sortedNames | ( | ) | const |
Sorted list of the zone names.
Definition at line 333 of file ZoneMesh.C.
Foam::wordList sortedNames | ( | const wordRe & | matcher | ) | const |
Sorted list of zone names satisfying the input matcher.
Definition at line 344 of file ZoneMesh.C.
Foam::wordList sortedNames | ( | const wordRes & | matcher | ) | const |
Sorted list of zone names satisfying the input matchers.
Definition at line 357 of file ZoneMesh.C.
Foam::labelList indices | ( | const wordRe & | matcher, |
const bool | useGroups = true |
||
) | const |
Return (sorted) zone indices for all matches.
Optionally matches zone groups. A no-op (returns empty list) for an empty matcher
Definition at line 371 of file ZoneMesh.C.
Referenced by ZoneMesh< cellZone, polyMesh >::findIndices(), multiphaseMangrovesTurbulenceModel::read(), and sampledFaceZone::zoneIDs().
Foam::labelList indices | ( | const wordRes & | matcher, |
const bool | useGroups = true |
||
) | const |
Return (sorted) zone indices for all matches.
Optionally matches zone groups. A no-op (returns empty list) for an empty matcher
Definition at line 444 of file ZoneMesh.C.
Foam::label findIndex | ( | const wordRe & | key | ) | const |
Zone index for the first match, return -1 if not found.
A no-op (returns -1) for an empty key
Definition at line 491 of file ZoneMesh.C.
Referenced by sampledCuttingPlane::sampledCuttingPlane(), sampledInterface::sampledInterface(), sampledIsoSurface::sampledIsoSurface(), and sampledPlane::sampledPlane().
Foam::label findIndex | ( | const wordRes & | matcher | ) | const |
Zone index for the first match, return -1 if not found.
A no-op (returns -1) for an empty matcher
Definition at line 505 of file ZoneMesh.C.
Foam::label findZoneID | ( | const word & | zoneName | ) | const |
Find zone index by name, return -1 if not found.
A no-op (returns -1) for an empty zoneName
Definition at line 519 of file ZoneMesh.C.
Referenced by surfaceZonesInfo::addCellZone(), surfaceZonesInfo::addFaceZone(), cellZoneSet::cellZoneSet(), extractEulerianParticles::checkFaceZone(), FaceInteraction< CloudType >::FaceInteraction(), FacePostProcessing< CloudType >::FacePostProcessing(), faceZoneSet::faceZoneSet(), dynamicMultiMotionSolverFvMesh::init(), pointZoneSet::pointZoneSet(), powerLawLopesdaCostaZone::powerLawLopesdaCostaZone(), RemoveParcels< CloudType >::RemoveParcels(), sizeDistribution::setCellZoneCells(), displacementLayeredMotionMotionSolver::solve(), cellZoneSet::writeObject(), pointZoneSet::writeObject(), faceZoneSet::writeObject(), and zeroATCcells::zeroATCcells().
const ZoneType * cfindZone | ( | const word & | zoneName | ) | const |
Find zone by name and return const pointer, nullptr on error.
A no-op (returns nullptr) for an empty zoneName
Definition at line 553 of file ZoneMesh.C.
ZoneType * findZone | ( | const word & | zoneName | ) |
Find zone by name and return pointer, nullptr on error.
A no-op (returns nullptr) for an empty zoneName
Definition at line 589 of file ZoneMesh.C.
Foam::bitSet selection | ( | const labelUList & | zoneIds | ) | const |
Return all elements (cells, faces, points) contained in the listed zones.
The bitSet is empty (zero-size) if there are no elements matched anywhere.
Definition at line 599 of file ZoneMesh.C.
Foam::bitSet selection | ( | const wordRe & | matcher, |
const bool | useGroups = true |
||
) | const |
Return all elements (cells, faces, points) that match the zone specification as a bitSet.
The bitSet is empty (zero-size) if there are no elements matched anywhere. Optionally matches zoneGroups. A no-op (returns empty bitSet) for an empty matcher
Definition at line 629 of file ZoneMesh.C.
Foam::bitSet selection | ( | const wordRes & | matcher, |
const bool | useGroups = true |
||
) | const |
Return all elements (cells, faces, points) that match the zone specification as a bitSet.
The bitSet is empty (zero-size) if there are no elements matched anywhere. A no-op (returns empty bitSet) for an empty matcher
Definition at line 641 of file ZoneMesh.C.
const Foam::HashTable< Foam::labelList > & groupZoneIDs | ( | ) | const |
The zone indices per zone group.
Definition at line 653 of file ZoneMesh.C.
void setGroup | ( | const word & | groupName, |
const labelUList & | zoneIDs | ||
) |
Set/add group with zones.
Definition at line 666 of file ZoneMesh.C.
Check zone definition. Return true if in error.
Definition at line 733 of file ZoneMesh.C.
Check whether all procs have all zones and in same order.
Definition at line 752 of file ZoneMesh.C.
void movePoints | ( | const pointField & | pts | ) |
Correct zone mesh after moving points.
Definition at line 828 of file ZoneMesh.C.
void clearAddressing | ( | ) |
Clear addressing.
Definition at line 709 of file ZoneMesh.C.
Referenced by interRegionExplicitPorositySource::initialise(), polyMesh::updateMesh(), cellZoneSet::writeObject(), pointZoneSet::writeObject(), and faceZoneSet::writeObject().
void clear | ( | ) |
Clear the zones.
Definition at line 724 of file ZoneMesh.C.
Referenced by cellTable::addCellZones(), blockMesh::mesh(), and fvMeshTools::newMesh().
|
inline |
Definition at line 270 of file ZoneMesh.H.
Return const reference to zone by name.
Fatal if the zone does not exist.
Definition at line 867 of file ZoneMesh.C.
Return reference to an existing zone by name.
Fatal if the zone does not exist.
Definition at line 887 of file ZoneMesh.C.
Find an existing zone by name or create a new empty one if required.
To determine if the zone already existed or was newly created, it will be necessary to add additional logic in the caller. For example,
zoneName | the name of the zone |
verbose | report if an existing zone was selected or a new zone was created. |
Definition at line 907 of file ZoneMesh.C.
void updateMetaData | ( | ) |
Update internal meta-data (eg, prior to writing)
Definition at line 840 of file ZoneMesh.C.
The writeData member function required by regIOobject.
Definition at line 856 of file ZoneMesh.C.
Identical to the indices() method (AUG-2018)
Definition at line 328 of file ZoneMesh.H.
|
static |
Debug switch to disallow the use of generic zones.
Definition at line 106 of file ZoneMesh.H.