86 const word& labelsName,
92 if (!labelsName.empty())
94 dict.readEntry<labelList>(labelsName, *this, keyType::LITERAL);
101 const zone& originalZone,
112 const zone& originalZone,
124 const zone& originalZone,
143 auto& map = *lookupMapPtr_;
144 map.reserve(addr.
size());
146 for (
const label
id : addr)
148 map.insert(
id, map.size());
152 return *lookupMapPtr_;
158 return lookupMap().
lookup(globalID, -1);
171 lookupMapPtr_.reset(
nullptr);
185 bool hasError =
false;
191 for (
const label
id : addr)
193 if (id < 0 || id >= maxSize)
200 <<
"Zone " << this->
name()
201 <<
" contains invalid index label " <<
id <<
nl
202 <<
"Valid index labels are 0.." << (maxSize-1) <<
endl;
210 else if (!elems.
insert(
id))
215 <<
"Zone " << this->
name()
216 <<
" contains duplicate index label " <<
id <<
endl;
236 os <<
nl << zn.name()
bool insert(const Key &key)
Insert a new entry, not overwriting existing entries.
const T & lookup(const Key &key, const T &deflt) const
Return hashed entry if it exists, or return the given default.
void reserve(label numEntries)
Reserve space for at least the specified number of elements (not the number of buckets) and regenerat...
void transfer(List< label > &list)
void operator=(const UList< label > &list)
A HashTable to objects of type <T> with a label key.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
void size(const label n)
Older name for setAddressableSize.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
A class for handling words, derived from Foam::string.
Identifies a mesh zone by name and index, with optional physical type and group information.
zoneIdentifier(const zoneIdentifier &)=default
Copy construct.
void write(Ostream &os) const
Write (physicalType, inGroups) dictionary entries (without surrounding braces).
label index() const noexcept
The index of this zone in the zone list.
const word & name() const noexcept
The zone name.
Base class for mesh zones.
const Map< label > & lookupMap() const
Demand-driven: the look-up map from global to local id.
virtual bool checkDefinition(const bool report=false) const =0
Check zone definition. Return true if in error.
virtual void clearPrimitives()
Clear primitive addressing.
label localID(const label globalID) const
Lookup local address in zone for given global index.
virtual void write(Ostream &os) const
Write (dictionary entries).
zone()
Default construct: empty zone with name="", index=0.
virtual void clearAddressing()
Clear addressing (remove lookup maps and other auxiliary information).
#define defineTypeName(Type)
Define the typeName.
OBJstream os(runTime.globalPath()/outputName)
#define WarningInFunction
Report a warning using Foam::Warning.
#define SeriousErrorInFunction
Report an error message using Foam::SeriousError.
List< label > labelList
A List of labels.
HashSet< label, Hash< label > > labelHashSet
A HashSet of labels, uses label hasher.
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces).
Ostream & endl(Ostream &os)
Add newline and flush stream.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
UList< label > labelUList
A UList of labels.
constexpr char nl
The newline '\n' character (0x0a).