83 const word& resultName
87 fieldNames_(fieldNames),
88 resultName_(resultName)
95 <<
"functionObject::" <<
type() <<
" " <<
name
96 <<
" requires at least 2 fields only "
109 if (fieldNames_.empty() ||
dict.found(
"fields"))
111 dict.readEntry(
"fields", fieldNames_);
125 <<
" functionObjects::" <<
type() <<
" " <<
name()
126 <<
" cannot find required fields " << fieldNames_ <<
endl;
146 return clearObject(resultName_);
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
bool empty() const noexcept
True if List is empty (ie, size() is zero).
void size(const label n)
Older name for setAddressableSize.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
virtual bool read(const dictionary &dict)
Read and set the function object if its data have changed.
virtual const word & type() const =0
Runtime type information.
Intermediate class for handling field expression function objects (e.g. add, subtract etc....
wordList fieldNames_
Names of fields to process.
virtual bool read(const dictionary &dict)
Read the function-object dictionary.
word resultName_
Name of result fields.
void setResultName(const word &typeName, const wordList &defaultArg=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 name, Time and dictionary.
virtual bool execute()
Execute the function-object operations.
virtual bool write()
Write the function-object results.
virtual bool calc()=0
Calculate expression.
fvMeshFunctionObject(const fvMeshFunctionObject &)=delete
No copy construct.
bool writeObject(const word &fieldName)
Write field if present in the (sub) objectRegistry.
bool clearObject(const word &fieldName)
Clear field from the (sub) objectRegistry if present.
A class for handling words, derived from Foam::string.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
Function objects are OpenFOAM utilities to ease workflow configurations and enhance workflows.
List< word > wordList
List of word.
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
const word GlobalIOList< Tuple2< scalar, vector > >::typeName("scalarVectorTable")
Ostream & endl(Ostream &os)
Add newline and flush stream.
IOerror FatalIOError
Error stream (stdout output on all processes), with additional 'FOAM FATAL IO ERROR' header text and ...
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
errorManipArg< error, int > exit(error &err, const int errNo=1)
messageStream Warning
Warning stream (stdout output on master, null elsewhere), with additional 'FOAM Warning' header text.