33 namespace functionObjects
52 const word& defaultArg
55 if (fieldName_.empty())
57 fieldName_ = defaultArg;
60 if (resultName_.empty())
62 if (fieldName_ != defaultArg)
64 resultName_ = typeName +
'(' + fieldName_ +
')';
68 resultName_ = typeName;
76 Foam::functionObjects::fieldExpression::fieldExpression
81 const word& fieldName,
82 const word& resultName
86 fieldName_(fieldName),
87 resultName_(resultName)
105 if (fieldName_.empty() || dict.
found(
"field"))
107 dict.
lookup(
"field") >> fieldName_;
110 if (dict.
found(
"result"))
112 dict.
lookup(
"result") >> resultName_;
124 <<
"functionObject " <<
type() <<
": Cannot find required field " 125 << fieldName_ <<
endl;
141 return writeObject(resultName_);
147 return clearObject(resultName_);
A list of keyword definitions, which are a keyword followed by any number of values (e...
Ostream & endl(Ostream &os)
Add newline and flush stream.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
void setResultName(const word &typeName, const word &defaultArg)
virtual bool read(const dictionary &)
Read optional controls.
bool read(const char *, int32_t &)
virtual ~fieldExpression()
Destructor.
A class for handling words, derived from string.
virtual bool write()
Write the result field.
virtual bool read(const dictionary &)
Read the fieldExpression data.
bool found(const word &, bool recursive=false, bool patternMatch=true) const
Search dictionary for given keyword.
virtual bool execute()
Calculate the result field.
virtual bool clear()
Clear the result field from the objectRegistry.
fileName::Type type(const fileName &)
Return the file type: DIRECTORY or FILE.
Specialization of Foam::functionObject for an Foam::fvMesh, providing a reference to the Foam::fvMesh...
defineTypeNameAndDebug(fvMeshFunctionObject, 0)
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.