38 #ifndef Foam_ZoneMesh_H 39 #define Foam_ZoneMesh_H 55 template<
class ZoneType,
class MeshType>
class ZoneMesh;
57 template<
class ZoneType,
class MeshType>
58 Ostream& operator<<(Ostream& os, const ZoneMesh<ZoneType, MeshType>& zones);
65 template<
class ZoneType,
class MeshType>
68 public PtrList<ZoneType>,
74 const MeshType& mesh_;
77 mutable autoPtr<Map<label>> zoneMapPtr_;
80 mutable autoPtr<HashTable<labelList>> groupIDsPtr_;
89 void calcZoneMap()
const;
92 bool hasGroupIDs()
const;
95 void calcGroupIDs()
const;
98 ZoneMesh(
const ZoneMesh&) =
delete;
101 void operator=(
const ZoneMesh<ZoneType, MeshType>&) =
delete;
123 const MeshType&
mesh,
131 const MeshType&
mesh,
154 label
whichZone(
const label objectIndex)
const;
187 const bool useGroups =
true 196 const bool useGroups =
true 235 const bool useGroups =
true 246 const bool useGroups =
true 308 ZoneType&
operator()(
const word& zoneName,
const bool verbose=
false);
322 friend Ostream& operator<< <ZoneType, MeshType>
bool checkParallelSync(const bool report=false) const
Check whether all procs have all zones and in same order.
const labelIOList & zoneIDs
wordList types() const
Return a list of zone types.
void clearAddressing()
Clear addressing.
ZoneType * findZone(const word &zoneName)
Find zone by name and return pointer, nullptr on error.
void clear()
Clear the zones.
label findIndex(const wordRe &key) const
Zone index for the first match, return -1 if not found.
const Map< label > & zoneMap() const
Map of zones containing zone index for all zoned elements.
FOAM_DEPRECATED_FOR(2022-09, "get(), set() or test() methods") const T *operator()(const label i) const
Deprecated(2022-09) - same as get()
const MeshType & mesh() const noexcept
Return the mesh reference.
void movePoints(const pointField &pts)
Correct zone mesh after moving points.
static word groupName(StringType base, const word &group)
Create dot-delimited name.group string.
labelList findIndices(const wordRes &key) const
Identical to the indices() method (AUG-2018)
labelList indices(const wordRe &matcher, const bool useGroups=true) const
Return (sorted) zone indices for all matches.
label findZoneID(const word &zoneName) const
Find zone index by name, return -1 if not found.
A class for handling words, derived from Foam::string.
void setGroup(const word &groupName, const labelUList &zoneIDs)
Set/add group with zones.
label size() const noexcept
The number of entries in the list.
A List of wordRe with additional matching capabilities.
A HashTable similar to std::unordered_map.
A wordRe is a Foam::word, but can contain a regular expression for matching words or strings...
An Ostream is an abstract base class for all output systems (streams, files, token lists...
OBJstream os(runTime.globalPath()/outputName)
const ZoneType & operator[](const word &zoneName) const
Return const reference to zone by name.
label whichZone(const label objectIndex) const
Given a global object index, return the zone it is in.
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
auto key(const Type &t) -> typename std::enable_if< std::is_enum< Type >::value, typename std::underlying_type< Type >::type >::type
wordList groupNames() const
A list of the zone group names (if any)
bool checkDefinition(const bool report=false) const
Check zone definition. Return true if in error.
wordList names() const
A list of the zone names.
bitSet selection(const labelUList &zoneIds) const
Return all elements (cells, faces, points) contained in the listed zones.
bool hasZoneMap() const noexcept
The zoneMap has been allocated.
wordList sortedNames() const
Sorted list of the zone names.
ZoneType & operator()(const word &zoneName, const bool verbose=false)
Find an existing zone by name or create a new empty one if required.
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, IOobject::NO_REGISTER)
Defines the attributes of an object for which implicit objectRegistry management is supported...
static int disallowGenericZones
Debug switch to disallow the use of generic zones.
const ZoneType * cfindZone(const word &zoneName) const
Find zone by name and return const pointer, nullptr on error.
bool writeData(Ostream &os) const
The writeData member function required by regIOobject.
const HashTable< labelList > & groupZoneIDs() const
The zone indices per zone group.
void updateMetaData()
Update internal meta-data (eg, prior to writing)