template<std::size_t numVars, class Scalar = double>
class Dumux::FunctionFromStringExpression< numVars, Scalar >
- Template Parameters
-
numVars | number of variables in the expression; number of function arguments of the call operator |
Scalar | type of numerical values in the expression |
Example usage
std::string expr =
getParam(
"Problem.Function");
FunctionFromStringExpression<2> f(expr, "xt");
const double x = 1.0, t = 2.0;
const double result = f(x, t);
T getParam(Args &&... args)
A free function to get a parameter from the parameter tree singleton.
Definition: parameters.hh:139
For variables with several characters construct
FunctionFromStringExpression<2> f(expr, std::array<std::string, 2>{{"pos", "time"}});
|
| FunctionFromStringExpression (const std::string &expression, const std::array< std::string, numVars > &variableNames) |
| Constructor from math expression and array of variable names. More...
|
|
| FunctionFromStringExpression (const std::string &expression, std::string_view variableNames) |
| Delegating constructor using all characters of a string as variables. More...
|
|
template<class S , std::enable_if_t< std::is_convertible_v< Scalar, S >, int > = 0> |
Scalar | operator() (const std::array< S, numVars > ¶ms) const |
|
template<class S , std::enable_if_t< std::is_convertible_v< Scalar, S >, int > = 0> |
Scalar | operator() (const Dune::FieldVector< S, numVars > ¶ms) const |
|
template<class ... Params, std::enable_if_t<(sizeof...(Params)==numVars) &&(std::is_convertible_v< Scalar, std::decay_t< Params > > &&...), int > = 0> |
Scalar | operator() (Params &&... params) const |
|
void | setVerbosity (unsigned int v) |
|