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()
65 requireUpdate_ =
false;
72 V_ =
gSum(volMesh_.
V());
79 cellIds_ = cellSet(volMesh_,
regionName_).sortedToc();
91 <<
". Valid cell zones : "
103 nCells_ = selected.size();
105 for (
const label celli : selected)
107 V_ += volMesh_.
V()[celli];
110 reduce(nCells_, sumOp<label>());
111 reduce(V_, sumOp<scalar>());
118 <<
" Region has no cells" <<
nl
133 file<<
setw(1) <<
':' <<
setw(1) <<
' '
134 << regionTypeNames_[regionType_] <<
' ' << regionName_ <<
endl;
149 requireUpdate_(
true),
155 regionTypeNames_.getOrDefault
162 regionName_(volMesh_.name()),
177 regionName_ = volMesh_.name();
184 dict.readEntry(
"name", regionName_);
191 <<
"Unknown region type. Valid region types: "
209 <<
"Retrieving cached values that are not up-to-date" <<
nl
221 return volMesh_.cellZones()[regionID_];
246 requireUpdate_ =
true;
252 requireUpdate_ =
true;
List< label > labelList
A List of labels.
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< T > & null()
Return a null List.
bool update()
Update the cached values as required.
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.
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)
const cellZoneMesh & cellZones() const noexcept
Return cell zone mesh.
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.
FlatOutput::OutputAdaptor< Container, Delimiters > flatOutput(const Container &obj, Delimiters delim)
Global flatOutput() function with specified output delimiters.
Omanip< int > setw(const int i)
label findZoneID(const word &zoneName) const
Find zone index by 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.
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.
label nTotalCells() const noexcept
Return total number of cells in decomposed mesh.
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.