22 "Computes a functor material from a parsed expression of other functors.");
24 "expression",
"FunctionExpression",
"Expression to parse for the new functor material");
25 params.
addParam<std::vector<std::string>>(
26 "functor_names", {},
"Functors to use in the parsed expression");
27 params.
addParam<std::vector<std::string>>(
30 "Symbolic name to use for each functor in 'functor_names' in the parsed expression. If not " 31 "provided, then the actual functor names must be used in the parsed expression.");
33 "Name to give the new functor material property");
42 _expression(getParam<
std::string>(
"expression")),
43 _functor_names(getParam<
std::vector<
std::string>>(
"functor_names")),
44 _n_functors(_functor_names.size()),
45 _functor_symbols(getParam<
std::vector<
std::string>>(
"functor_symbols")),
46 _property_name(getParam<
std::string>(
"property_name"))
55 "The number of entries must be equal to either zero or the number of entries in " 69 addFunctorProperty<GenericReal<is_ad>>(
78 const auto r_point = r.getPoint();
93 _parsed_function = std::make_shared<SymFunction>();
96 std::vector<std::string> symbols(_functor_symbols);
99 symbols_str += symbols_str.empty() ?
"x,y,z" :
",x,y,z";
101 mooseError(
"ParsedFunctorMaterial assumes the dimension is always equal to 3.");
102 symbols_str += symbols_str.empty() ?
"t" :
",t";
105 this->parsedFunctionSetup(_parsed_function,
113 _func_params.resize(_n_functors +
Moose::dim + 1);
GenericReal< is_ad > evaluate(SymFunctionPtr &, const std::string &object_name="")
Evaluate FParser object and check EvalError.
Moose::GenericType< Real, is_ad > GenericReal
FEProblemBase & _fe_problem
void buildParsedFunction()
Builds the parsed function.
const std::string & _name
The name of this class.
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 ...
static InputParameters validParams()
MooseEnumIterator begin() const
Returns a begin/end iterator to all of the set values in the enum.
registerMooseObject("MooseApp", ParsedFunctorMaterial)
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
std::vector< std::string > _functor_symbols
Symbolic name to use for each functor.
static constexpr std::size_t dim
This is the dimension of all vector and tensor datastructures used in MOOSE.
const std::vector< std::string > & _functor_names
Functors to use in the parsed expression.
MooseEnumIterator end() const
FunctorMaterials compute functor material properties.
Real getTimeFromStateArg(const Moose::StateArg &state) const
Returns the time associated with the requested state.
Computes a functor material from a parsed expression of other functors.
std::string stringify(const T &t)
conversion to string
ParsedFunctorMaterialTempl(const InputParameters ¶meters)
const std::string & _property_name
Name to give the new functor material property.
const ExecFlagEnum & _execute_enum
Execute settings for this object.
SymFunctionPtr _parsed_function
The parsed function.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
std::vector< GenericReal< is_ad > > _func_params
Array to stage the parameters passed to the functions when calling Eval.
IntRange< T > make_range(T beg, T end)
static InputParameters validParams()
std::vector< const Moose::Functor< GenericReal< is_ad > > * > _functors
Functors.
auto index_range(const T &sizable)
const unsigned int _n_functors
Number of functors.
static InputParameters validParams()