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 |
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 keyType &key) const |
Return zone indices for all matches. More... | |
labelList | indices (const wordRes &matcher) const |
Return zone indices for all matches. More... | |
label | findIndex (const keyType &key) const |
Return zone index for the first match, return -1 if not found. More... | |
label | findIndex (const wordRes &matcher) const |
Return zone index for the first match, return -1 if not found. More... | |
label | findZoneID (const word &zoneName) const |
Find zone index given a name, return -1 if not found. More... | |
bitSet | selection (const labelUList &zoneIds) const |
bitSet | selection (const keyType &key) const |
bitSet | selection (const wordRes &matcher) const |
const ZoneType * | zonePtr (const word &zoneName) const |
Lookup zone by name and return const pointer, nullptr on error. More... | |
ZoneType * | zonePtr (const word &zoneName) |
Lookup zone by name and return pointer, nullptr on error. More... | |
void | clearAddressing () |
Clear addressing. More... | |
void | clear () |
Clear the 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... | |
bool | writeData (Ostream &os) const |
writeData member function required by regIOobject More... | |
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) |
labelList | findIndices (const keyType &key) const |
Identical to the indices() method (AUG-2018) More... | |
template<class UnaryMatchPredicate > | |
Foam::wordList | namesImpl (const PtrList< ZoneType > &list, const UnaryMatchPredicate &matcher, const bool doSort) |
template<class UnaryMatchPredicate > | |
Foam::labelList | indicesImpl (const PtrList< ZoneType > &list, const UnaryMatchPredicate &matcher) |
template<class UnaryMatchPredicate > | |
Foam::label | findIndexImpl (const PtrList< ZoneType > &list, const UnaryMatchPredicate &matcher) |
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 230 of file ZoneMesh.C.
Construct given size.
Definition at line 246 of file ZoneMesh.C.
Construct given a PtrList.
Definition at line 264 of file ZoneMesh.C.
~ZoneMesh | ( | ) |
Destructor.
Definition at line 292 of file ZoneMesh.C.
|
inline |
Return the mesh reference.
Definition at line 159 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 302 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 315 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 324 of file ZoneMesh.C.
Foam::wordList names | ( | ) | const |
A list of the zone names.
Definition at line 340 of file ZoneMesh.C.
Referenced by preserveFaceZones::add(), surfaceZonesInfo::addCellZonesToMesh(), preserveFaceZones::apply(), meshRefinement::checkCoupledFaceZones(), extractEulerianParticles::checkFaceZone(), 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 357 of file ZoneMesh.C.
Foam::wordList names | ( | const wordRes & | matcher | ) | const |
A list of zone names satisfying the input matchers.
Definition at line 367 of file ZoneMesh.C.
Foam::wordList sortedNames | ( | ) | const |
Sorted list of the zone names.
Definition at line 377 of file ZoneMesh.C.
Foam::wordList sortedNames | ( | const wordRe & | matcher | ) | const |
Sorted list of zone names satisfying the input matcher.
Definition at line 388 of file ZoneMesh.C.
Foam::wordList sortedNames | ( | const wordRes & | matcher | ) | const |
Sorted list of zone names satisfying the input matchers.
Definition at line 398 of file ZoneMesh.C.
Foam::labelList indices | ( | const keyType & | key | ) | const |
Return zone indices for all matches.
Definition at line 409 of file ZoneMesh.C.
Referenced by ZoneMesh< cellZone, polyMesh >::findIndices(), and multiphaseMangrovesTurbulenceModel::read().
Foam::labelList indices | ( | const wordRes & | matcher | ) | const |
Return zone indices for all matches.
Definition at line 434 of file ZoneMesh.C.
Foam::label findIndex | ( | const keyType & | key | ) | const |
Return zone index for the first match, return -1 if not found.
Definition at line 449 of file ZoneMesh.C.
Referenced by sampledCuttingPlane::sampledCuttingPlane(), sampledIsoSurface::sampledIsoSurface(), and sampledPlane::sampledPlane().
Foam::label findIndex | ( | const wordRes & | matcher | ) | const |
Return zone index for the first match, return -1 if not found.
Definition at line 474 of file ZoneMesh.C.
Foam::label findZoneID | ( | const word & | zoneName | ) | const |
Find zone index given a name, return -1 if not found.
Definition at line 484 of file ZoneMesh.C.
Referenced by surfaceZonesInfo::addCellZone(), surfaceZonesInfo::addFaceZone(), cellZoneSet::cellZoneSet(), extractEulerianParticles::checkFaceZone(), FacePostProcessing< CloudType >::FacePostProcessing(), faceZoneSet::faceZoneSet(), pointZoneSet::pointZoneSet(), powerLawLopesdaCostaZone::powerLawLopesdaCostaZone(), RemoveParcels< CloudType >::RemoveParcels(), sizeDistribution::setCellZoneCells(), displacementLayeredMotionMotionSolver::solve(), cellZoneSet::writeObject(), pointZoneSet::writeObject(), faceZoneSet::writeObject(), and zeroATCcells::zeroATCcells().
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 525 of file ZoneMesh.C.
Foam::bitSet selection | ( | const keyType & | key | ) | 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.
Definition at line 555 of file ZoneMesh.C.
Foam::bitSet selection | ( | const wordRes & | matcher | ) | 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.
Definition at line 565 of file ZoneMesh.C.
const ZoneType * zonePtr | ( | const word & | zoneName | ) | const |
Lookup zone by name and return const pointer, nullptr on error.
Definition at line 575 of file ZoneMesh.C.
ZoneType * zonePtr | ( | const word & | zoneName | ) |
Lookup zone by name and return pointer, nullptr on error.
Definition at line 597 of file ZoneMesh.C.
void clearAddressing | ( | ) |
Clear addressing.
Definition at line 618 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 632 of file ZoneMesh.C.
Referenced by cellTable::addCellZones(), and fvMeshTools::newMesh().
Check zone definition. Return true if in error.
Definition at line 641 of file ZoneMesh.C.
Check whether all procs have all zones and in same order.
Definition at line 660 of file ZoneMesh.C.
void movePoints | ( | const pointField & | pts | ) |
Correct zone mesh after moving points.
Definition at line 736 of file ZoneMesh.C.
writeData member function required by regIOobject
Definition at line 748 of file ZoneMesh.C.
Return const reference to zone by name.
Fatal if the zone does not exist.
Definition at line 759 of file ZoneMesh.C.
Return reference to an existing zone by name.
Fatal if the zone does not exist.
Definition at line 779 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 799 of file ZoneMesh.C.
Identical to the indices() method (AUG-2018)
Definition at line 303 of file ZoneMesh.H.
Foam::wordList namesImpl | ( | const PtrList< ZoneType > & | list, |
const UnaryMatchPredicate & | matcher, | ||
const bool | doSort | ||
) |
Definition at line 145 of file ZoneMesh.C.
Foam::labelList indicesImpl | ( | const PtrList< ZoneType > & | list, |
const UnaryMatchPredicate & | matcher | ||
) |
Definition at line 180 of file ZoneMesh.C.
Foam::label findIndexImpl | ( | const PtrList< ZoneType > & | list, |
const UnaryMatchPredicate & | matcher | ||
) |
Definition at line 207 of file ZoneMesh.C.
|
static |
Debug switch to disallow the use of generic zones.
Definition at line 123 of file ZoneMesh.H.