33 namespace functionObjects
80 const word& resultName
85 resultName_(resultName)
92 <<
"functionObject::" <<
type() <<
" " <<
name
93 <<
" requires at least 2 fields only "
112 if (fieldNames_.empty() ||
dict.found(
"fields"))
114 dict.lookup(
"fields") >> fieldNames_;
117 if (
dict.found(
"result"))
119 dict.lookup(
"result") >> resultName_;
141 #define findFieldType(Type, GeoField) \
144 || mesh_.foundObject<GeoField<Type>>(fieldNames_[i]);
152 notFoundFieldNames.
append(fieldNames_[i]);
156 if (!notFoundFieldNames.
empty())
159 <<
"functionObjects::" <<
type() <<
" " <<
name()
160 <<
" cannot find fields " << notFoundFieldNames <<
endl;
165 <<
"functionObjects::" <<
type() <<
" " <<
name()
166 <<
" fields are not compatible with the " <<
type()
167 <<
" function" <<
endl;
184 return writeObject(resultName_);
190 return clearObject(resultName_);
#define forAll(list, i)
Loop across all elements in list.
DynamicList< T, SizeInc, SizeMult, SizeDiv > & append(const T &)
Append an element at the end of the list.
Generic GeometricField class.
void size(const label)
Override size to be inconsistent with allocated storage.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
bool empty() const
Return true if the UList is empty (ie, size() is zero)
A list of keyword definitions, which are a keyword followed by any number of values (e....
A functionName is a word starting with '#'.
virtual const word & type() const =0
Runtime type information.
const word & name() const
Return the name of this functionObject.
wordList fieldNames_
Names of fields to process.
virtual wordList fields() const
Return the list of fields required.
word resultName_
Name of result fields.
virtual ~fieldsExpression()
Destructor.
void setResultName(const word &functionName, const wordList &defaultFieldNames=wordList::null())
Set the result name.
virtual bool clear()
Clear the result fields from the objectRegistry.
fieldsExpression(const word &name, const Time &runTime, const dictionary &dict, const wordList &fieldNames=wordList::null(), const word &resultName=word::null)
Construct from Time and dictionary.
virtual bool execute()
Calculate the result fields.
virtual bool write()
Write the result fields.
virtual bool read(const dictionary &)
Read the fieldsExpression data.
Specialisation of Foam::functionObject for an Foam::fvMesh, providing a reference to the Foam::fvMesh...
virtual bool read(const dictionary &)
Read optional controls.
A class for handling words, derived from string.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
#define findFieldType(Type, GeoField)
static List< word > fieldNames
defineTypeNameAndDebug(adjustTimeStepToCombustion, 0)
errorManipArg< error, int > exit(error &err, const int errNo=1)
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.
FOR_ALL_FIELD_TYPES(DefineContiguousFvWallLocationDataType)
typename VolField< Type >::Internal VolInternalField
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.