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 199 case operationType::minMag:
209 case operationType::maxMag:
217 return processValuesTypeType(values, weights, V, result);
234 writeLocation_(
false),
235 operation_(operationTypeNames_.read(dict.
lookup(
"operation"))),
251 writeLocation_(
false),
252 operation_(operationTypeNames_.read(dict.
lookup(
"operation"))),
296 forAll(weightFieldNames_, i)
298 weights *= getFieldValues<scalar>(weightFieldNames_[i]);
304 const word& fieldName = fields_[i];
307 #define writeValuesFieldType(fieldType, none) \ 308 ok = ok || writeValues<fieldType>(fieldName, weights, V); 310 #undef writeValuesFieldType 314 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.
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
A list of keyword definitions, which are a keyword followed by any number of values (e...
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.
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.
layerAndWeight min(const layerAndWeight &a, const layerAndWeight &b)
#define writeFileHeaderLocationFieldType(fieldType, none)
Volume (cell) region selection class.
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.
FOR_ALL_FIELD_TYPES(DefineFvWallInfoType)
dimensioned< scalar > mag(const dimensioned< Type > &)
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.