35 namespace functionObjects
85 Info<<
name() <<
" " << operationTypeNames_[operation_]
86 <<
" weight fields " << weightFieldNames_;
88 else if (dict.
found(
"weightField"))
90 weightFieldNames_.setSize(1);
91 dict.
lookup(
"weightField") >> weightFieldNames_[0];
93 Info<<
name() <<
" " << operationTypeNames_[operation_]
94 <<
" weight field " << weightFieldNames_[0];
99 Info<<
" scale factor = " << scaleFactor_ <<
nl;
112 case operationType::minMag:
113 case operationType::maxMag:
117 file() << tab <<
"processor";
127 void Foam::functionObjects::fieldValues::volFieldValue::
128 writeFileHeaderLocation<Foam::scalar>()
134 case operationType::minMag:
135 case operationType::maxMag:
136 file() <<
tab <<
"location" <<
tab <<
"cell";
139 file() << tab <<
"processor";
155 writeCommented(
file(),
"Time");
159 file() <<
tab << operationTypeNames_[operation_] <<
"(";
161 forAll(weightFieldNames_, i)
163 file() << weightFieldNames_[i] <<
',';
166 file() << fields_[fieldi] <<
")";
170 #define writeFileHeaderLocationFieldType(fieldType, none) \ 171 if (validField<fieldType>(fields_[fieldi])) \ 173 writeFileHeaderLocation<fieldType>(); \ 176 #undef writeHeaderLocationFieldType 195 case operationType::minMag:
201 case operationType::maxMag:
209 return processValuesTypeType(values, weights, V, result);
226 writeLocation_(
false),
227 operation_(operationTypeNames_.read(dict.
lookup(
"operation"))),
243 writeLocation_(
false),
244 operation_(operationTypeNames_.read(dict.
lookup(
"operation"))),
288 forAll(weightFieldNames_, i)
290 weights *= getFieldValues<scalar>(weightFieldNames_[i]);
296 const word& fieldName = fields_[i];
299 #define writeValuesFieldType(fieldType, none) \ 300 ok = ok || writeValues<fieldType>(fieldName, weights, V); 302 #undef writeValuesFieldType 306 cannotFindObject(fieldName);
#define writeValuesFieldType(fieldType, none)
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.
bool found(const word &, bool recursive=false, bool patternMatch=true) const
Search dictionary for given keyword.
#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.
A list of keyword definitions, which are a keyword followed by any number of values (e...
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
addToRunTimeSelectionTable(functionObject, fieldValueDelta, dictionary)
void initialise(const dictionary &dict)
Initialise, e.g. cell addressing.
Forward declare the result structure.
Ostream & endl(Ostream &os)
Add newline and flush stream.
virtual bool read(const dictionary &dict)
Read from dictionary.
A simple wrapper around bool so that it can be read as a word: true/false, on/off, yes/no, y/n, t/f, or none/any.
static bool master(const label communicator=0)
Am I the master process.
volFieldValue(const word &name, const Time &runTime, const dictionary &dict)
Construct from name, Time and dictionary.
#define FOR_ALL_FIELD_TYPES(Macro,...)
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.
bool read(const char *, int32_t &)
bool isNull(const T &t)
Return true if t is a reference to the nullObject of type T.
A class for handling words, derived from string.
defineTypeNameAndDebug(fieldValueDelta, 0)
bool readIfPresent(const word &, T &, bool recursive=false, bool patternMatch=true) const
Find an entry if present, and assign to T.
virtual ~volFieldValue()
Destructor.
#define writeFileHeaderLocationFieldType(fieldType, none)
Volume (cell) region selection class.
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
word name(const complex &)
Return a string representation of a complex.
void writeFileHeader(const writeFile &wf, Ostream &file)
Output file header information.
static bool & parRun()
Is this a parallel run?
virtual void writeFileHeader(const label i)
Output file header information.
operationType
Operation type enumeration.
#define Log
Report write to Foam::Info if the local log switch is true.
Base class for field value -based function objects.
Registry of regIOobjects.
virtual bool write()
Calculate and write.
virtual bool read(const dictionary &)
Read from dictionary.
const fvMesh & mesh_
Reference to the fvMesh.
static const NamedEnum< operationType, 11 > operationTypeNames_
Operation type names.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
virtual bool write()
Write.
void writeFileHeaderLocation()
Output file header location information for a given type.