21 "Sets field array variable values to the evaluation of a parsed expression.");
24 "expression",
"FunctionExpression",
"Parsed function expression to compute");
25 params.
addCoupledVar(
"coupled_variables",
"Vector of coupled variable names.");
26 params.
addCoupledVar(
"coupled_array_variables",
"Vector of coupled array variable names.");
31 "Make coordinate (x,y,z) and time (t) variables available in the function expression.");
32 params.
addParam<std::vector<std::string>>(
35 "Vector of constants used in the parsed function (use this for kB etc.)");
36 params.
addParam<std::vector<std::string>>(
37 "constant_expressions",
39 "Vector of values for the constants in constant_names (can be an FParser expression)");
47 _function(getParam<
std::string>(
"expression")),
48 _n_vars(coupledComponents(
"coupled_variables")),
49 _n_array_vars(coupledComponents(
"coupled_array_variables")),
50 _vars(coupledValues(
"coupled_variables")),
51 _array_vars(coupledArrayValues(
"coupled_array_variables")),
52 _use_xyzt(getParam<bool>(
"use_xyzt"))
55 std::string variables;
59 variables += (i == 0 ?
"" :
",") +
getFieldVar(
"coupled_variables", i)->
name();
62 const auto & var = *
getArrayVar(
"coupled_array_variables", i);
65 "The number of components in '",
69 ") does not match the number of components in '",
74 variables += (i == 0 &&
_n_vars == 0 ?
"" :
",") + var.name();
78 const std::vector<std::string> xyzt = {
"x",
"y",
"z",
"t"};
81 variables += (variables.empty() ?
"" :
",") + v;
84 _func_F = std::make_shared<SymFunction>();
88 getParam<std::vector<std::string>>(
"constant_names"),
89 getParam<std::vector<std::string>>(
"constant_expressions"),
GenericReal< is_ad > evaluate(SymFunctionPtr &, const std::string &object_name="")
Evaluate FParser object and check EvalError.
void paramError(const std::string ¶m, Args... args) const
Emits an error prefixed with the file and line number of the given param (from the input file) along ...
const T & getParam(const std::string &name) const
Retrieve a parameter for the object.
registerMooseObject("MooseApp", ArrayParsedAux)
unsigned int count() const
Get the number of components Note: For standard and vector variables, the number is one...
virtual RealEigenVector computeValue() override
Compute and return the value of the aux variable.
static constexpr std::size_t dim
This is the dimension of all vector and tensor datastructures used in MOOSE.
const Parallel::Communicator & comm() const
const bool _use_xyzt
Import coordinates and time.
const std::string & name() const
Get the name of the class.
const std::vector< const VariableValue * > _vars
Regular variable values.
static InputParameters validParams()
void parsedFunctionSetup(SymFunctionPtr &function, const std::string &expression, const std::string &variables, const std::vector< std::string > &constant_names, const std::vector< std::string > &constant_expressions, const libMesh::Parallel::Communicator &comm) const
Performs setup steps on a SymFunction.
MooseVariableField< ComputeValueType > & _var
This is a regular kernel so we cast to a regular MooseVariable.
std::vector< GenericReal< is_ad > > _func_params
Array to stage the parameters passed to the functions when calling Eval.
ArrayMooseVariable * getArrayVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled array variable.
IntRange< T > make_range(T beg, T end)
unsigned int _qp
Quadrature point index.
const unsigned int _n_array_vars
Number of coupled array variables.
static InputParameters validParams()
static InputParameters validParams()
Eigen::Matrix< Real, Eigen::Dynamic, 1 > RealEigenVector
Base class for creating new auxiliary kernels and auxiliary boundary conditions.
const std::vector< const ArrayVariableValue * > _array_vars
Array variable values.
std::string _function
Function expression.
AuxKernel that evaluates a parsed function expression for each component of an array variable...
ArrayParsedAux(const InputParameters ¶meters)
const MooseArray< Point > & _q_point
Active quadrature points.
SymFunctionPtr _func_F
Function parser object that is evaluated for setting aux-variable values.
const unsigned int _n_vars
Number of coupled regular variables.
bool isNodal() const
Nodal or elemental kernel?
const MooseVariableFieldBase * getFieldVar(const std::string &var_name, unsigned int comp) const