49 lookupMapPtr_(nullptr)
57 lookupMapPtr_(nullptr)
70 lookupMapPtr_(nullptr)
83 lookupMapPtr_(nullptr)
91 const word& labelsName,
97 lookupMapPtr_(nullptr)
103 const zone& origZone,
114 const zone& origZone,
119 zone(origZone.
name(), std::move(addr), index)
142 auto& lm = *lookupMapPtr_;
146 lm.insert(addr[i], i);
150 return *lookupMapPtr_;
156 return lookupMap().lookup(globalID, -1);
170 bool hasError =
false;
175 for (
const label idx : addr)
177 if (idx < 0 || idx >= maxSize)
184 <<
"Zone " << this->
name()
185 <<
" contains invalid index label " << idx <<
nl
186 <<
"Valid index labels are 0.."
187 << maxSize-1 <<
endl;
195 else if (!elems.
insert(idx))
200 <<
"Zone " << this->
name()
201 <<
" contains duplicate index label " << idx <<
endl;
213 << nl << static_cast<const labelList&>(*
this);
bool insert(const Key &key)
Insert a new entry, not overwriting existing entries.
virtual bool check(const char *operation) const
Check IOstream status for given operation.
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,...
virtual bool write()
Write the output fields.
A class for handling words, derived from Foam::string.
Identifies a mesh zone by name and index, with optional physical type and group information.
Base class for mesh zones.
const Map< label > & lookupMap() const
Demand-driven: the look-up map from global to local id.
virtual ~zone()
Destructor.
virtual bool checkDefinition(const bool report=false) const =0
Check zone definition. Return true if in error.
label localID(const label globalID) const
Lookup local address in zone for given global index.
virtual void write(Ostream &os) const
Write.
virtual void clearAddressing()
Clear addressing.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
Template functions to aid in the implementation of demand driven data.
OBJstream os(runTime.globalPath()/outputName)
#define WarningInFunction
Report a warning using Foam::Warning.
#define DebugInFunction
Report an information message using Foam::Info.
#define SeriousErrorInFunction
Report an error message using Foam::SeriousError.
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 INVALID.
void deleteDemandDrivenData(DataPtr &dataPtr)
constexpr char nl
The newline '\n' character (0x0a)
#define forAll(list, i)
Loop across all elements in list.