Go to the documentation of this file.
38 namespace functionObjects
51 { regionTypes::vrtAll,
"all" },
52 { regionTypes::vrtCellSet,
"cellSet" },
53 { regionTypes::vrtCellZone,
"cellZone" },
59 void Foam::functionObjects::volRegion::calculateCache()
69 V_ =
gSum(volMesh_.
V());
76 cellIds_ = cellSet(volMesh_,
regionName_).sortedToc();
88 <<
". Valid cell zones : "
101 for (
const label celli :
cellIDs())
103 V_ += volMesh_.
V()[celli];
105 reduce(V_, sumOp<scalar>());
112 <<
" Region has no cells"
116 requireUpdate_ =
false;
129 file<<
setw(1) <<
':' <<
setw(1) <<
' '
130 << regionTypeNames_[regionType_] <<
" " << regionName_ <<
endl;
145 requireUpdate_(
true),
151 regionTypeNames_.getOrDefault
158 regionName_(volMesh_.name()),
173 regionName_ = volMesh_.name();
180 dict.readEntry(
"name", regionName_);
187 <<
"Unknown region type. Valid region types are:"
205 <<
"Retrieving cached values that are not up-to-date" <<
nl
217 return volMesh_.cellZones()[regionID_];
242 requireUpdate_ =
true;
248 requireUpdate_ =
true;
label regionID_
Region ID (zone ID, ...)
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
static const List< label > & null()
Return a null List.
bool update()
Update the cached values as required.
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
word regionName_
Region name (cellSet, cellZone, ...)
static constexpr const zero Zero
Global zero (0)
bool read(const char *buf, int32_t &val)
Same as readInt32.
label nTotalCells() const
Return total number of cells in decomposed mesh.
const cellZoneMesh & cellZones() const
Return cell zone mesh.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Type gSum(const FieldField< Field, Type > &f)
regionTypes
Region type enumeration.
void writeHeaderValue(Ostream &os, const string &property, const Type &value) const
Write a (commented) header property and value pair.
virtual void updateMesh(const mapPolyMesh &)
Update for changes of mesh.
Mesh consisting of general polyhedral cells.
regionTypes regionType_
Region type.
virtual bool read(const dictionary &dict)
Read from dictionary.
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
volRegion(const fvMesh &mesh, const dictionary &dict)
Construct from fvMesh and dictionary.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Mesh data needed to do the Finite Volume discretisation.
Omanip< int > setw(const int i)
label findZoneID(const word &zoneName) const
Find zone index given a name, return -1 if not found.
wordList names() const
A list of the zone names.
errorManipArg< error, int > exit(error &err, const int errNo=1)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
virtual void writeCommented(Ostream &os, const string &str) const
Write a commented string to stream.
FlatOutput< Container > flatOutput(const Container &obj, label len=0)
Global flatOutput function.
static const Enum< regionTypes > regionTypeNames_
Region type names.
virtual void movePoints(const polyMesh &)
Update for mesh point-motion.
void clear()
Clear the list, i.e. set size to zero.
const labelList & cellIDs() const
Return the local list of cell IDs.
defineTypeNameAndDebug(ObukhovLength, 0)
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
void writeFileHeader(const writeFile &wf, Ostream &file) const
Output file header information.
Base class for writing single files from the function objects.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
const globalMeshData & globalData() const
Return parallel info.
const DimensionedField< scalar, volMesh > & V() const
Return cell volumes.