21 "Sets a field variable value to the evaluation of a parsed expression.");
24 "function",
"FunctionExpression",
"Parsed function expression to compute");
26 params.
addCoupledVar(
"args",
"Vector of coupled variable names");
32 "Make coordinate (x,y,z) and time (t) variables available in the function expression.");
33 params.
addParam<std::vector<std::string>>(
36 "Vector of constants used in the parsed function (use this for kB etc.)");
37 params.
addParam<std::vector<std::string>>(
38 "constant_expressions",
40 "Vector of values for the constants in constant_names (can be an FParser expression)");
48 _function(getParam<
std::string>(
"expression")),
49 _nargs(coupledComponents(
"coupled_variables")),
50 _args(coupledValues(
"coupled_variables")),
51 _use_xyzt(getParam<bool>(
"use_xyzt"))
54 std::string variables;
57 for (std::size_t i = 0; i <
_nargs; ++i)
58 variables += (i == 0 ?
"" :
",") +
getFieldVar(
"coupled_variables", i)->
name();
61 const std::vector<std::string> xyzt = {
"x",
"y",
"z",
"t"};
64 variables += (variables.empty() ?
"" :
",") + v;
67 _func_F = std::make_shared<SymFunction>();
74 getParam<std::vector<std::string>>(
"constant_names"),
75 getParam<std::vector<std::string>>(
"constant_expressions"));
107 for (std::size_t j = 0; j <
_nargs; ++j)
112 for (std::size_t j = 0; j < LIBMESH_DIM; ++j)
GenericReal< is_ad > evaluate(SymFunctionPtr &, const std::string &object_name="")
Evaluate FParser object and check EvalError.
const unsigned int _nargs
coupled variables
const std::string & name() const override
Get the variable name.
processor_id_type rank() const
const Parallel::Communicator & _communicator
const bool _use_xyzt
import coordinates and time
void addFParserConstants(SymFunctionPtr &parser, const std::vector< std::string > &constant_names, const std::vector< std::string > &constant_expressions)
add constants (which can be complex expressions) to the parser object
virtual const std::string & name() const
Get the name of the class.
AuxKernel that evaluates a parsed function expression.
SymFunctionPtr _func_F
function parser object for the resudual and on-diagonal Jacobian
std::string _function
function expression
const T & getParam(const std::string &name) const
Retrieve a parameter for the object.
registerMooseObject("MooseApp", ParsedAux)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
bool _disable_fpoptimizer
std::vector< GenericReal< is_ad > > _func_params
Array to stage the parameters passed to the functions when calling Eval.
void mooseError(Args &&... args) const
Emits an error prefixed with object name and type.
unsigned int _qp
Quadrature point index.
const std::vector< const VariableValue * > _args
static InputParameters validParams()
static InputParameters validParams()
static InputParameters validParams()
ParsedAux(const InputParameters ¶meters)
virtual Real computeValue() override
Compute and return the value of the aux variable.
const MooseArray< Point > & _q_point
Active quadrature points.
bool isNodal() const
Nodal or elemental kernel?
void setParserFeatureFlags(SymFunctionPtr &)
apply input paramters to internal feature flags of the parser object
const MooseVariableFieldBase * getFieldVar(const std::string &var_name, unsigned int comp) const