Go to the documentation of this file.
35 const word& entryName,
44 if (
dict.getOrDefault(
"debug",
false))
50 dict.readEntry(
"expression", expr);
54 if (valueExpr_.empty())
57 <<
"The expression was not defined!" <<
nl
61 driver_.readDict(dict_);
73 valueExpr_(rhs.valueExpr_),
74 driver_(1, rhs.driver_)
87 driver_.clearVariables();
89 driver_.setArgument(
x);
91 driver_.parse(this->valueExpr_);
96 <<
"Evaluated: " << result <<
nl;
98 if (!result.hasValue() || !result.size() || !result.isType<Type>())
101 <<
"Could not evaluate: " << this->valueExpr_
105 return result.cref<Type>().first();
129 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...
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
A polymorphic field/result from evaluating an expression.
word name(const complex &c)
Return string representation of complex.
Function1Expression(const word &entryName, const dictionary &dict)
Construct from entry name and dictionary.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
virtual Type integrate(const scalar x1, const scalar x2) const
Integrate between two values.
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.
#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.