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]);
registerMooseObject("MooseApp", GenericFunctionMaterial)
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application.
const Function & getFunctionByName(const FunctionName &name) const
Get a function with a given name.
This material automatically declares as material properties whatever is passed to it through the para...
std::vector< FunctionName > _prop_values
The functions to use for each property.
void computeQpFunctions()
A helper method for evaluating the functions.
static InputParameters validParams()
std::vector< const Function * > _functions
Vector of pointers to the functions, stored here after retrieval using their name.
virtual void initQpStatefulProperties() override
Initialize stateful properties at quadrature points.
unsigned int _num_props
Number of properties that will be defined.
std::vector< std::string > _prop_names
Names of the material properties to define.
virtual void computeQpProperties() override
Users must override this method.
GenericFunctionMaterialTempl(const InputParameters ¶meters)
std::vector< GenericMaterialProperty< Real, is_ad > * > _properties
Vector of all the properties.
Materials compute MaterialProperties.
static InputParameters validParams()