21 params.
addClassDescription(
"Material object for declaring properties that are populated by " 22 "evaluation of Function object.");
23 params.
addParam<std::vector<std::string>>(
"prop_names",
24 "The names of the properties this material will have");
25 params.
addParam<std::vector<FunctionName>>(
"prop_values",
26 "The corresponding names of the " 27 "functions that are going to provide " 28 "the values for the variables");
36 _prop_names(getParam<
std::vector<
std::string>>(
"prop_names")),
37 _prop_values(getParam<
std::vector<FunctionName>>(
"prop_values"))
42 if (num_names != num_values)
44 "Number of prop_names must match the number of prop_values for a GenericFunctionMaterial!");
76 for (
unsigned int i = 0; i < _num_props; i++)
77 (*_properties[i])[_qp] = (*_functions[i]).
value(_t, _q_point[_qp]);
virtual void initQpStatefulProperties() override
Initialize stateful properties at quadrature points.
GenericFunctionMaterialTempl(const InputParameters ¶meters)
std::vector< std::string > _prop_names
Names of the material properties to define.
std::vector< GenericMaterialProperty< Real, is_ad > * > _properties
Vector of all the properties.
Real value(unsigned n, unsigned alpha, unsigned beta, Real x)
static InputParameters validParams()
std::vector< FunctionName > _prop_values
The functions to use for each property.
void computeQpFunctions()
A helper method for evaluating the functions.
This material automatically declares as material properties whatever is passed to it through the para...
Materials compute MaterialProperties.
const Function & getFunctionByName(const FunctionName &name) const
Get a function with a given name.
virtual void computeQpProperties() override
Users must override this method.
void mooseError(Args &&... args) const
Emits an error prefixed with object name and type.
registerMooseObject("MooseApp", GenericFunctionMaterial)
static InputParameters validParams()
unsigned int _num_props
Number of properties that will be defined.
std::vector< const Function * > _functions
Vector of pointers to the functions, stored here after retrieval using their name.