Go to the documentation of this file.
34 template<
class ZoneType,
class MeshType>
42 <<
"zone map already calculated"
52 nObjects += this->operator[](zoneI).size();
62 const labelList& zoneObjects = this->operator[](zoneI);
66 zm.insert(zoneObjects[objI], zoneI);
73 template<
class ZoneType,
class MeshType>
78 readOpt() == IOobject::MUST_READ
79 || readOpt() == IOobject::MUST_READ_IF_MODIFIED
80 || (readOpt() == IOobject::READ_IF_PRESENT && headerOk())
83 if (readOpt() == IOobject::MUST_READ_IF_MODIFIED)
86 <<
"Specified IOobject::MUST_READ_IF_MODIFIED but class"
87 <<
" does not support automatic rereading."
94 Istream& is = readStream(typeName);
106 patchEntries[zoneI].keyword(),
107 patchEntries[zoneI].
dict(),
118 "(const IOobject&, const MeshType&)"
136 template<
class ZoneType,
class MeshType>
153 template<
class ZoneType,
class MeshType>
157 const MeshType&
mesh,
161 PtrList<ZoneType>(size),
171 template<
class ZoneType,
class MeshType>
175 const MeshType&
mesh,
176 const PtrList<ZoneType>& pzm
187 PtrList<ZoneType>& zones = *
this;
188 zones.setSize(pzm.size());
191 zones.set(zoneI, pzm[zoneI].clone(*this).ptr());
199 template<
class ZoneType,
class MeshType>
209 template<
class ZoneType,
class MeshType>
224 template<
class ZoneType,
class MeshType>
227 const label objectIndex
233 if (zmIter == zm.end())
245 template<
class ZoneType,
class MeshType>
254 lst[zoneI] = zones[zoneI].type();
262 template<
class ZoneType,
class MeshType>
271 lst[zoneI] = zones[zoneI].name();
278 template<
class ZoneType,
class MeshType>
298 if (key ==
operator[](i).
name())
300 indices[nFound++] = i;
311 template<
class ZoneType,
class MeshType>
324 if (!indices.empty())
333 if (key ==
operator[](i).
name())
346 template<
class ZoneType,
class MeshType>
356 if (zones[zoneI].
name() == zoneName)
365 Info<<
"label ZoneMesh<ZoneType>::findZoneID(const word&) const : "
366 <<
"Zone named " << zoneName <<
" not found. "
367 <<
"List of available zone names: " << names() <<
endl;
375 template<
class ZoneType,
class MeshType>
386 lst |=
static_cast<const labelList&
>(this->operator[](indices[i]));
393 template<
class ZoneType,
class MeshType>
402 zones[zoneI].clearAddressing();
407 template<
class ZoneType,
class MeshType>
416 template<
class ZoneType,
class MeshType>
422 bool inError =
false;
428 inError |= zones[zoneI].checkDefinition(report);
434 template<
class ZoneType,
class MeshType>
440 if (!Pstream::parRun())
448 bool hasError =
false;
452 allNames[Pstream::myProcNo()] = this->names();
453 Pstream::gatherList(allNames);
454 Pstream::scatterList(allNames);
457 allTypes[Pstream::myProcNo()] = this->types();
458 Pstream::gatherList(allTypes);
459 Pstream::scatterList(allTypes);
463 for (
label procI = 1; procI < allNames.
size(); procI++)
467 (allNames[procI] != allNames[0])
468 || (allTypes[procI] != allTypes[0])
473 if (debug || (report && Pstream::master()))
475 Info<<
" ***Inconsistent zones across processors, "
476 "processor 0 has zone names:" << allNames[0]
477 <<
" zone types:" << allTypes[0]
478 <<
" processor " << procI <<
" has zone names:"
480 <<
" zone types:" << allTypes[procI]
491 if (zones[zoneI].checkParallelSync(
false))
495 if (debug || (report && Pstream::master()))
497 Info<<
" ***Zone " << zones[zoneI].name()
498 <<
" of type " << zones[zoneI].type()
499 <<
" is not correctly synchronised"
500 <<
" across coupled boundaries."
501 <<
" (coupled faces are either not both"
502 <<
" present in set or have same flipmap)" <<
endl;
513 template<
class ZoneType,
class MeshType>
520 zones[zoneI].movePoints(
p);
526 template<
class ZoneType,
class MeshType>
535 template<
class ZoneType,
class MeshType>
541 const label zoneI = findZoneID(zoneName);
546 <<
"Zone named " << zoneName <<
" not found." <<
nl
547 <<
"Available zone names: " << names() <<
endl
551 return operator[](zoneI);
555 template<
class ZoneType,
class MeshType>
561 const label zoneI = findZoneID(zoneName);
566 <<
"Zone named " << zoneName <<
" not found." <<
nl
567 <<
"Available zone names: " << names() <<
endl
571 return operator[](zoneI);
577 template<
class ZoneType,
class MeshType>
581 const ZoneMesh<ZoneType, MeshType>& zones
584 os << zones.size() <<
nl << token::BEGIN_LIST;
588 zones[zoneI].writeDict(os);
591 os << token::END_LIST;
const Map< label > & zoneMap() const
Map of zones containing zone index for all zoned elements.
bool checkDefinition(const bool report=false) const
Check zone definition. Return true if in error.
void clear()
Clear the zones.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
label findIndex(const keyType &) const
Return zone index for the first match, return -1 if not found.
A class for handling words, derived from string.
autoPtr< BasicCompressibleTurbulenceModel > New(const volScalarField &rho, const volVectorField &U, const surfaceScalarField &phi, const typename BasicCompressibleTurbulenceModel::transportModel &transport, const word &propertiesName)
#define forAll(list, i)
Loop across all elements in list.
bool isPattern() const
Should be treated as a match rather than a literal string.
Template functions to aid in the implementation of demand driven data.
bool read(const char *, int32_t &)
bool read()
Read if IOobject flags set. Return true if read.
ZoneMesh(const ZoneMesh &)
Disallow construct as copy.
Ostream & endl(Ostream &os)
Add newline and flush stream.
void deleteDemandDrivenData(DataPtr &dataPtr)
A class for handling keywords in dictionaries.
bool set(const label) const
Is element set.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Pre-declare SubField and related Field type.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
void movePoints(const pointField &)
Correct zone mesh after moving points.
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
label whichZone(const label objectIndex) const
Given a global object index, return the zone it is in.
virtual bool check(const char *operation) const
Check IOstream status for given operation.
PackedBoolList findMatching(const keyType &) const
Mark cells that match the zone specification.
void calcZoneMap() const
Create zone map.
errorManip< error > abort(error &err)
label findZoneID(const word &zoneName) const
Find zone index given a name.
wordList names() const
Return a list of zone names.
void setSize(const label)
Reset size of List.
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
bool findStrings(const wordReListMatcher &matcher, const std::string &str)
Return true if string matches one of the regular expressions.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
labelList findIndices(const keyType &) const
Return zone indices for all matches.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
label size() const
Return the number of elements in the PtrList.
void setSize(const label)
Reset size of PtrList. If extending the PtrList, new entries are.
bool writeData(Ostream &) const
writeData member function required by regIOobject
Operations on lists of strings.
void size(const label)
Override size to be inconsistent with allocated storage.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
void clearAddressing()
Clear addressing.
bool good() const
Return true if next operation might succeed.
labelList findIndices(const ListType &, typename ListType::const_reference, const label start=0)
Find all occurences of given element. Linear search.
bool checkParallelSync(const bool report=false) const
Check whether all procs have all zones and in same order. Return.
#define WarningInFunction
Report a warning using Foam::Warning.
word name(const complex &)
Return a string representation of a complex.
wordList types() const
Return a list of zone types.