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
121 lookupMapPtr_(nullptr)
125 template<
class ZoneType,
class ZonesType>
136 lookupMapPtr_(nullptr)
140 template<
class ZoneType,
class ZonesType>
151 lookupMapPtr_(nullptr)
155 template<
class ZoneType,
class ZonesType>
160 const ZonesType& zones
166 lookupMapPtr_(nullptr)
170 template<
class ZoneType,
class ZonesType>
175 const ZonesType& zones
181 lookupMapPtr_(nullptr)
185 template<
class ZoneType,
class ZonesType>
196 <<
"Constructing " << ZoneType::typeName <<
" " <<
name <<
endl;
201 typename dictionaryConstructorTable::iterator cstrIter =
202 dictionaryConstructorTablePtr_->find(
type);
204 if (cstrIter == dictionaryConstructorTablePtr_->end())
209 ) <<
"Unknown " << ZoneType::typeName <<
" type "
211 <<
"Valid " << ZoneType::typeName <<
" types are:" <<
nl
212 << dictionaryConstructorTablePtr_->sortedToc()
222 template<
class ZoneType,
class ZonesType>
231 template<
class ZoneType,
class ZonesType>
238 template<
class ZoneType,
class ZonesType>
259 template<
class ZoneType,
class ZonesType>
267 return *lookupMapPtr_;
271 template<
class ZoneType,
class ZonesType>
278 template<
class ZoneType,
class ZonesType>
287 bool hasError =
false;
294 if (indices[i] < 0 || indices[i] >= maxSize)
302 <<
" contains invalid index label " << indices[i] <<
nl
303 <<
"Valid index labels are 0.."
304 << maxSize-1 <<
endl;
312 else if (!elems.
insert(indices[i]))
318 <<
" contains duplicate index label " << indices[i] <<
endl;
327 template<
class ZoneType,
class ZonesType>
331 indices.
insert(newIndices);
336 template<
class ZoneType,
class ZonesType>
344 template<
class ZoneType,
class ZonesType>
351 template<
class ZoneType,
class ZonesType>
360 template<
class ZoneType,
class ZonesType>
368 template<
class ZoneType,
class ZonesType>
376 template<
class ZoneType,
class ZonesType>
384 template<
class ZoneType,
class ZonesType>
394 template<
class ZoneType,
class ZonesType>
398 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.
Zone(const word &name, const labelUList &indices, const ZonesType &zones)
Construct from components.
virtual void writeDict(Ostream &) const =0
Write dictionary.
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.
virtual 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.
virtual void mapMesh(const polyMeshMap &)
Update from another mesh using the given map.
virtual ~Zone()
Destructor.
void insert(const labelHashSet &newIndices)
Insert given indices into zone.
virtual void clearAddressing()
Clear addressing.
void select(const Type &zone)
Select the.
static autoPtr< ZoneType > New(const word &name, const dictionary &, const ZonesType &)
Return a pointer to a new cell zone.
void operator=(const Zone &)
Assignment operator.
const ZonesType & zones() const
Return ZonesType reference.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
A list of keyword definitions, which are a keyword followed by any number of values (e....
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
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 FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
#define WarningInFunction
Report a warning using Foam::Warning.
#define InfoInFunction
Report an information message using Foam::Info.
#define SeriousErrorInFunction
Report an error message using Foam::SeriousError.
errorManipArg< error, int > exit(error &err, const int errNo=1)
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.
word name(const bool)
Return a word representation of a bool.
void deleteDemandDrivenData(DataType *&dataPtr)
errorManip< error > abort(error &err)
Ostream & operator<<(Ostream &os, const fvConstraints &constraints)
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
static iteratorEnd end()
iteratorEnd set to beyond the end of any HashTable