33 template<
class ZoneType,
class ZonesType>
45 if (zone.contains(ctrs[i]))
47 indices[nInZone++] = i;
55 template<
class ZoneType,
class ZonesType>
61 <<
"Lookup map already calculated" <<
nl
77 template<
class ZoneType,
class ZonesType>
90 if (map[i] >= 0 && localIndex(map[i]) != -1)
98 if (reverseMap[i] >= 0 && localIndex(i) != -1)
100 indices.
insert(reverseMap[i]);
104 labelList::operator=(indices.
sortedToc());
110 template<
class ZoneType,
class ZonesType>
115 const ZonesType& zones,
116 const bool moveUpdate,
117 const bool topoUpdate
123 moveUpdate_(moveUpdate),
124 topoUpdate_(topoUpdate),
125 lookupMapPtr_(nullptr)
129 template<
class ZoneType,
class ZonesType>
134 const ZonesType& zones,
135 const bool moveUpdate,
136 const bool topoUpdate
142 moveUpdate_(moveUpdate),
143 topoUpdate_(topoUpdate),
144 lookupMapPtr_(nullptr)
148 template<
class ZoneType,
class ZonesType>
153 const ZonesType& zones
161 lookupMapPtr_(nullptr)
165 template<
class ZoneType,
class ZonesType>
171 const ZonesType& zones
177 moveUpdate_(z.moveUpdate_),
178 topoUpdate_(z.topoUpdate_),
179 lookupMapPtr_(nullptr)
183 template<
class ZoneType,
class ZonesType>
189 const ZonesType& zones
195 moveUpdate_(z.moveUpdate_),
196 topoUpdate_(z.topoUpdate_),
197 lookupMapPtr_(nullptr)
203 template<
class ZoneType,
class ZonesType>
212 template<
class ZoneType,
class ZonesType>
219 template<
class ZoneType,
class ZonesType>
229 if (lmIter == lm.
end())
240 template<
class ZoneType,
class ZonesType>
248 return *lookupMapPtr_;
252 template<
class ZoneType,
class ZonesType>
259 template<
class ZoneType,
class ZonesType>
268 bool hasError =
false;
275 if (indices[i] < 0 || indices[i] >= maxSize)
283 <<
" contains invalid index label " << indices[i] <<
nl
284 <<
"Valid index labels are 0.."
285 << maxSize-1 <<
endl;
293 else if (!elems.
insert(indices[i]))
299 <<
" contains duplicate index label " << indices[i] <<
endl;
308 template<
class ZoneType,
class ZonesType>
313 indices.
insert(newIndices);
318 template<
class ZoneType,
class ZonesType>
326 template<
class ZoneType,
class ZonesType>
333 template<
class ZoneType,
class ZonesType>
342 template<
class ZoneType,
class ZonesType>
352 template<
class ZoneType,
class ZonesType>
355 moveUpdate_ = zn.moveUpdate_;
356 topoUpdate_ = zn.topoUpdate_;
362 template<
class ZoneType,
class ZonesType>
370 template<
class ZoneType,
class ZonesType>
380 template<
class ZoneType,
class ZonesType>
384 os.
check(
"Ostream& operator<<(Ostream& f, const Zone& z");
#define forAll(list, i)
Loop across all elements in list.
bool insert(const Key &key)
Insert a new entry.
List< Key > sortedToc() const
Return the table of contents as a sorted list.
bool insert(const Key &, const T &newElmt)
Insert a new hashedEntry.
iterator find(const Key &)
Find and return an iterator set at the hashedEntry.
virtual bool check(const char *operation) const
Check IOstream status for given operation.
void size(const label)
Override size to be inconsistent with allocated storage.
void operator=(const UList< label > &)
Assignment to UList operator. Takes linear time.
void setSize(const label)
Reset size of List.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
void swap(UList< label > &)
Swap two ULists of the same type in constant time.
const Map< label > & lookupMap() const
Return a reference to the look-up map.
void swap(Zone &)
Swap two zones.
void topoChange(const labelList &map, const labelList &reverseMap)
Update the addressing using the maps provided.
bool checkDefinition(const label maxSize, const bool report=false) const
Check zone definition with max size given. Return true if in error.
void distribute(const polyDistributionMap &)
Redistribute or update using the given distribution map.
label localIndex(const label globalIndex) const
Map storing the local index for every global index. Used to find.
void calcLookupMap() const
Construct the look-up map.
void mapMesh(const polyMeshMap &)
Update from another mesh using the given map.
bool topoUpdate_
Flag indicating the zone is updated by the generator.
void insert(const labelHashSet &newIndices)
Insert given indices into zone.
void clearAddressing()
Clear addressing.
Zone(const word &name, const labelUList &indices, const ZonesType &zones, const bool moveUpdate=false, const bool topoUpdate=false)
Construct from components.
void select(const Type &zone)
Select the.
bool moveUpdate_
Flag indicating the zone is updated by the generator.
void operator=(const Zone &)
Assignment operator.
const ZonesType & zones() const
Return ZonesType reference.
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Calculates a unique integer (label so might not have enough room - 2G max) for processor + local inde...
Class containing mesh-to-mesh mapping information after a mesh distribution where we send parts of me...
Class containing mesh-to-mesh mapping information.
A class for handling words, derived from string.
Template functions to aid in the implementation of demand driven data.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
#define WarningInFunction
Report a warning using Foam::Warning.
#define SeriousErrorInFunction
Report an error message using Foam::SeriousError.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Ostream & endl(Ostream &os)
Add newline and flush stream.
void deleteDemandDrivenData(DataType *&dataPtr)
errorManip< error > abort(error &err)
word name(const LagrangianState state)
Return a string representation of a Lagrangian state enumeration.
Ostream & operator<<(Ostream &os, const fvConstraints &constraints)
static iteratorEnd end()
iteratorEnd set to beyond the end of any HashTable