36 namespace functionObjects
113 case operationType::minMag:
114 case operationType::maxMag:
128 void Foam::functionObjects::fieldValues::volFieldValue::
129 writeFileHeaderLocation<Foam::scalar>()
135 case operationType::minMag:
136 case operationType::maxMag:
137 file() <<
tab <<
"location" <<
tab <<
"cell";
140 file() <<
tab <<
"processor";
156 writeCommented(
file(),
"Time");
160 file() <<
tab << operationTypeNames_[operation_] <<
"(";
162 forAll(weightFieldNames_, i)
164 file() << weightFieldNames_[i] <<
',';
167 file() << fields_[fieldi] <<
")";
171 #define writeFileHeaderLocationFieldType(fieldType, none) \
172 if (validField<fieldType>(fields_[fieldi])) \
174 writeFileHeaderLocation<fieldType>(); \
177 #undef writeHeaderLocationFieldType
200 case operationType::minMag:
210 case operationType::maxMag:
218 return processValuesTypeType(values, weights, V, result);
235 writeLocation_(false),
236 operation_(operationTypeNames_.
read(
dict.lookup(
"operation"))),
252 writeLocation_(false),
253 operation_(operationTypeNames_.
read(
dict.lookup(
"operation"))),
285 bool anyFields =
false;
288 #define validFieldType(fieldType, none) \
289 anyFields = anyFields || validField<fieldType>(fields_[i]);
291 #undef validFieldType
293 if (!anyFields && fields_.size() > 1)
295 cannotFindObjects(fields_);
299 if (anyFields && operation_ != operationType::none)
305 if (anyFields && operation_ != operationType::none &&
Pstream::master())
312 forAll(weightFieldNames_, i)
314 weights *= getFieldValues<scalar>(weightFieldNames_[i]);
321 const word& fieldName = fields_[i];
324 #define writeValuesFieldType(fieldType, none) \
325 ok = ok || writeValues<fieldType>(fieldName, weights, V);
327 #undef writeValuesFieldType
331 cannotFindObject(fieldName);
336 if (anyFields && operation_ != operationType::none &&
Pstream::master())
#define forAll(list, i)
Loop across all elements in list.
Macros for easy insertion into run-time selection tables.
void setSize(const label)
Reset size of List.
Initialise the NamedEnum HashTable from the static list of names.
A simple wrapper around bool so that it can be read as a word: true/false, on/off,...
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
static bool master(const label communicator=0)
Am I the master process.
static bool & parRun()
Is this a parallel run?
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.
bool readIfPresent(const word &, T &, bool recursive=false, bool patternMatch=true) const
Find an entry if present, and assign to T.
bool found(const word &, bool recursive=false, bool patternMatch=true) const
Search dictionary for given keyword.
Abstract base-class for Time/database functionObjects.
const word & name() const
Return the name of this functionObject.
Base class for field value -based function objects.
virtual bool read(const dictionary &dict)
Read from dictionary.
const dictionary & dict() const
Return the reference to the construction dictionary.
virtual bool write()
Write.
Provides a 'fvCellSet' specialisation of the fieldValue function object.
scalar scaleFactor_
Scale factor - optional.
static const NamedEnum< operationType, 11 > operationTypeNames_
Operation type names.
Switch writeLocation_
Write the location if available for this operation - optional.
void initialise(const dictionary &dict)
Initialise, e.g. cell addressing.
void writeFileHeaderLocation()
Output file header location information for a given type.
operationType operation_
Operation to apply to values.
volFieldValue(const word &name, const Time &runTime, const dictionary &dict)
Construct from name, Time and dictionary.
virtual void writeFileHeader(const label i)
Output file header information.
wordList weightFieldNames_
Weight field names.
virtual ~volFieldValue()
Destructor.
virtual bool write()
Calculate and write.
bool processValues(const Field< Type > &values, const scalarField &weights, const scalarField &V, Result< ResultType > &result) const
Apply the operation to the values, and return true if successful.
virtual bool read(const dictionary &)
Read from dictionary.
operationType
Operation type enumeration.
const fvMesh & mesh_
Reference to the fvMesh.
General run-time selected cell set selection class for fvMesh.
void writeFileHeader(const functionObjects::writeFile &wf, Ostream &file)
Output file header information.
Registry of regIOobjects.
A class for handling words, derived from string.
#define Log
Report write to Foam::Info if the local log switch is true.
defineTypeNameAndDebug(fieldValueDelta, 0)
addToRunTimeSelectionTable(functionObject, fieldValueDelta, dictionary)
bool read(const char *, int32_t &)
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.
layerAndWeight min(const layerAndWeight &a, const layerAndWeight &b)
dimensioned< scalar > mag(const dimensioned< Type > &)
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
FOR_ALL_FIELD_TYPES(makeFieldSourceTypedef)
Forward declare the result structure.
#define writeFileHeaderLocationFieldType(fieldType, none)
#define writeValuesFieldType(fieldType, none)
#define validFieldType(fieldType, none)