|
IFEM
90A354
|
A scalar-valued function, general expression. More...
#include <ExprFunctions.h>


Public Member Functions | |
| EvalFuncScalar (const char *function, const char *x="x", Real eps=Real(1.0e-8)) | |
| The constructor parses the expression string. | |
| virtual | ~EvalFuncScalar () |
| Defaulted destructor. More... | |
| void | addDerivative (const std::string &function, const char *x="x") |
| Adds an expression function for a first derivative. | |
| bool | isConstant () const override |
| Returns whether the function is time-independent or not. | |
| Real | deriv (Real x) const override |
| Returns the first-derivative of the function. | |
| int | numError |
| Explicit instantiation. | |
| Real | deriv (Real x) const |
| Returns the first-derivative of the function. | |
Public Member Functions inherited from ScalarFunc | |
| Real | eval (Real x) const |
| Returns the function value for the argument x. | |
Public Member Functions inherited from utl::Function< Real, Real > | |
| virtual | ~Function () |
| Empty destructor. | |
| virtual bool | isZero () const |
| Returns whether the function is identically zero or not. | |
| Real | operator() (const Real &x) const |
| Operator returning the function value for the given argument. | |
Static Public Attributes | |
| static int | numError |
| Error counter - set by the exception handler. More... | |
Protected Member Functions | |
| Real | evaluate (const Real &x) const override |
| Evaluates the function expression. | |
Protected Member Functions inherited from ScalarFunc | |
| ScalarFunc () | |
| The constructor is protected to allow sub-class instances only. | |
Protected Member Functions inherited from utl::Function< Real, Real > | |
| Function () | |
| The constructor is protected to allow sub-class instances only. | |
Private Types | |
| using | Expression = ExprEval::Expression< Scalar > |
| Type alias for expression tree. | |
| using | FunctionList = ExprEval::FunctionList< Scalar > |
| Type alias for function list. | |
| using | ValueList = ExprEval::ValueList< Scalar > |
| Type alias for value list. | |
| using | FuncType = EvalFuncScalar< Scalar > |
| Type alias for function. | |
Private Attributes | |
| std::vector< std::unique_ptr< Expression > > | expr |
| Roots of the expression tree. | |
| std::vector< std::unique_ptr< FunctionList > > | f |
| Lists of functions. | |
| std::vector< std::unique_ptr< ValueList > > | v |
| Lists of variables and constants. | |
| std::vector< Scalar * > | arg |
| Function argument values. | |
| std::unique_ptr< FuncType > | gradient |
| First derivative expression. | |
| Real | dx |
| Domain increment for calculation of numerical derivative. | |
Additional Inherited Members | |
Public Types inherited from utl::Function< Real, Real > | |
| typedef Real | Input |
| Input type. | |
| typedef Real | Output |
| Output type. | |
A scalar-valued function, general expression.
|
virtualdefault |
Defaulted destructor.
The implementation needs to be in compile unit so we have the definition for the types of the unique_ptr's.
|
static |
Error counter - set by the exception handler.
Explicit instantiation of error flag.
Referenced by utl::parseRealFunc(), and utl::parseVecFunc().