35 namespace functionObjects
52 >::names[] = {
"cellZone",
"all"};
90 void Foam::functionObjects::fieldValues::volRegion::setCellZoneCells()
96 dict().lookup(
"name") >> regionName_;
98 label zoneId =
mesh().cellZones().findZoneID(regionName_);
103 <<
"Unknown cell zone name: " << regionName_
104 <<
". Valid cell zones are: " <<
mesh().cellZones().names()
108 cellId_ =
mesh().cellZones()[zoneId];
123 <<
"Unknown region type. Valid region types are:" 130 Pout<<
"Selected region size = " << cellId_.size() <<
endl;
135 Foam::scalar Foam::functionObjects::fieldValues::volRegion::volume()
const 137 return gSum(filterField(
mesh().V()));
154 << regionTypeNames_[regionType_] <<
"(" << regionName_ <<
"):" <<
nl 161 << regionTypeNames_[regionType_] <<
"(" << regionName_ <<
"):" <<
nl 162 <<
" total cells = " << nCells_ <<
nl 163 <<
" total volume = " << volume_
168 Info<<
" weight field = " << weightFieldName_;
180 writeCommented(file(),
"Region type : ");
181 file() << regionTypeNames_[regionType_] <<
" " << regionName_ <<
endl;
182 writeCommented(file(),
"Cells : ");
183 file() << nCells_ <<
endl;
184 writeCommented(file(),
"Volume : ");
185 file() << volume_ <<
endl;
187 writeCommented(file(),
"Time");
190 file() <<
tab <<
"Volume";
196 <<
tab << operationTypeNames_[operation_]
197 <<
"(" << fields_[i] <<
")";
214 regionType_(regionTypeNames_.read(dict.
lookup(
"regionType"))),
215 operation_(operationTypeNames_.read(dict.
lookup(
"operation"))),
218 weightFieldName_(
"none"),
221 if (!isA<fvMesh>(obr_))
239 regionType_(regionTypeNames_.read(dict.
lookup(
"regionType"))),
240 operation_(operationTypeNames_.read(dict.
lookup(
"operation"))),
243 weightFieldName_(
"none"),
246 if (!isA<fvMesh>(obr_))
292 file() <<
tab << volume_;
294 Log <<
" total volume = " << volume_ <<
endl;
299 const word& fieldName = fields_[i];
300 bool processed =
false;
302 processed = processed || writeValues<scalar>(fieldName);
303 processed = processed || writeValues<vector>(fieldName);
304 processed = processed || writeValues<sphericalTensor>(fieldName);
305 processed = processed || writeValues<symmTensor>(fieldName);
306 processed = processed || writeValues<tensor>(fieldName);
311 <<
"Requested field " << fieldName
312 <<
" not found in database and not processed"
virtual bool write()
Calculate and write.
#define forAll(list, i)
Loop across all elements in list.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
errorManipArg< error, int > exit(error &err, const int errNo=1)
A list of keyword definitions, which are a keyword followed by any number of values (e...
addToRunTimeSelectionTable(functionObject, fieldValueDelta, dictionary)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Ostream & endl(Ostream &os)
Add newline and flush stream.
virtual bool read(const dictionary &dict)
Read from dictionary.
static bool master(const label communicator=0)
Am I the master process.
labelList identity(const label len)
Create identity map (map[i] == i) of given length.
regionTypes
region type enumeration
Initialise the NamedEnum HashTable from the static list of names.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Macros for easy insertion into run-time selection tables.
void initialise(const dictionary &dict)
Initialise, e.g. cell addressing.
bool read(const char *, int32_t &)
static const NamedEnum< operationType, 11 > operationTypeNames_
Operation type names.
Type gSum(const FieldField< Field, Type > &f)
A class for handling words, derived from string.
bool readIfPresent(const word &, T &, bool recursive=false, bool patternMatch=true) const
Find an entry if present, and assign to T.
defineTypeNameAndDebug(fieldValueDelta, 0)
prefixOSstream Pout(cout,"Pout")
word name(const complex &)
Return a string representation of a complex.
static const NamedEnum< regionTypes, 2 > regionTypeNames_
region type names
fileName::Type type(const fileName &)
Return the file type: DIRECTORY or FILE.
#define WarningInFunction
Report a warning using Foam::Warning.
virtual bool read(const dictionary &)
Read from dictionary.
#define Log
Report write to Foam::Info if the local log switch is true.
volRegion(const word &name, const Time &runTime, const dictionary &dict)
Construct from name, Time and dictionary.
virtual ~volRegion()
Destructor.
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
virtual void writeFileHeader(const label i)
Output file header information.
Registry of regIOobjects.
T lookupOrDefault(const word &, const T &, bool recursive=false, bool patternMatch=true) const
Find and return a T,.
virtual bool write()
Write to screen/file.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
operationType
Operation type enumeration.