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
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;
102 <<
"Could not evaluate: " << this->valueExpr_ <<
nl
103 <<
"Result size:" << result.
size()
108 return result.
cref<Type>().first();
132 dict_.writeEntry(this->
name(), os);
Function1 with values supplied by a parsed expression.
virtual Type integrate(const scalar x1, const scalar x2) const
Integrate between two values.
Top level data entry class for use in dictionaries. Provides a mechanism to specify a variable as a c...
const word const dictionary & dict
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
virtual bool readDict(const dictionary &dict)
Read variables, tables etc.
A polymorphic field/result from evaluating an expression.
const word & valueType() const noexcept
Basic type for the field or single value.
label size() const
The field or object size.
bool isType() const
True if valueType corresponds to the given Type.
const Field< Type > & cref() const
Return const reference to the field.
bool hasValue() const
Has a value?
bool readEntry(const word &keyword, const dictionary &dict, bool mandatory=true, const bool stripComments=true)
void resetDb(const objectRegistry *obrPtr=nullptr) noexcept
Reset the associated objectRegistry.
Registry of regIOobjects.
A class for handling words, derived from Foam::string.
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
OBJstream os(runTime.globalPath()/outputName)
#define DebugInfo
Report an information message using Foam::Info.
static constexpr const zero Zero
Global zero (0)
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
errorManipArg< error, int > exit(error &err, const int errNo=1)
constexpr char nl
The newline '\n' character (0x0a)