Go to the documentation of this file.
35 const word& entryName,
45 if (
dict.getOrDefault(
"debug",
false))
50 valueExpr_.readEntry(
"expression", dict_);
53 if (valueExpr_.empty())
56 <<
"The expression was not defined!" <<
nl
60 driver_.readDict(dict_);
72 valueExpr_(rhs.valueExpr_),
73 driver_(1, rhs.driver_, dict_)
86 driver_.clearVariables();
88 driver_.setArgument(
x);
90 driver_.resetDb(this->whichDb());
92 driver_.parse(this->valueExpr_);
97 <<
"Evaluated: " << result <<
nl;
99 if (!result.hasValue() || !result.size() || !result.isType<Type>())
102 <<
"Could not evaluate: " << this->valueExpr_ <<
nl
103 <<
"Result size:" << result.size()
104 <<
" type:" << result.valueType() <<
nl
108 return result.cref<Type>().first();
132 dict_.writeEntry(this->
name(), os);
int debug
Static debugging option.
A class for handling words, derived from Foam::string.
static constexpr const zero Zero
Global zero (0)
virtual void writeData(Ostream &os) const
Write in dictionary format.
Top level data entry class for use in dictionaries. Provides a mechanism to specify a variable as a c...
Registry of regIOobjects.
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
A polymorphic field/result from evaluating an expression.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
OBJstream os(runTime.globalPath()/outputName)
virtual Type integrate(const scalar x1, const scalar x2) const
Integrate between two values.
Function1Expression(const word &entryName, const dictionary &dict, const objectRegistry *obrPtr=nullptr)
Construct from entry name, dictionary and optional registry.
errorManipArg< error, int > exit(error &err, const int errNo=1)
virtual Type value(const scalar x) const
Return value.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
#define DebugInfo
Report an information message using Foam::Info.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Function1 with values supplied by a parsed expression.