21 params.
addClassDescription(
"Material object for declaring vector properties that are populated "
22 "by evaluation of Function objects.");
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, "
29 "minor ordering by component");
37 _prop_names(getParam<
std::vector<
std::string>>(
"prop_names")),
38 _prop_values(getParam<
std::vector<FunctionName>>(
"prop_values"))
43 if (num_names * LIBMESH_DIM != num_values)
46 ") times the libmesh dimension (",
48 ") must match the number of prop_values (",
50 ") for a GenericFunctionVectorMaterial!");
83 for (
unsigned int i = 0; i < _num_props; i++)
85 (*_properties[i])[_qp](j) = (*_functions[i * LIBMESH_DIM + j]).value(_t, _q_point[_qp]);
registerMooseObject("MooseApp", GenericFunctionVectorMaterial)
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...
virtual void computeQpProperties() override
Users must override this method.
void computeQpFunctions()
A helper method for evaluating the functions.
virtual void initQpStatefulProperties() override
Initialize stateful properties at quadrature points.
unsigned int _num_props
Number of vector properties that will be defined.
std::vector< GenericMaterialProperty< RealVectorValue, is_ad > * > _properties
Vector of all the properties.
std::vector< FunctionName > _prop_values
The functions to use for each property's components.
std::vector< const Function * > _functions
Vector of pointers to the functions, stored here after retrieval using their name.
GenericFunctionVectorMaterialTempl(const InputParameters ¶meters)
std::vector< std::string > _prop_names
Names of the vector material properties to define.
static InputParameters validParams()
Materials compute MaterialProperties.
static InputParameters validParams()
static constexpr std::size_t dim
This is the dimension of all vector and tensor datastructures used in MOOSE.