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]);
virtual void initQpStatefulProperties() override
Initialize stateful properties at quadrature points.
std::vector< FunctionName > _prop_values
The functions to use for each property's components.
static InputParameters validParams()
static constexpr std::size_t dim
This is the dimension of all vector and tensor datastructures used in MOOSE.
registerMooseObject("MooseApp", GenericFunctionVectorMaterial)
virtual void computeQpProperties() override
Users must override this method.
unsigned int _num_props
Number of vector properties that will be defined.
GenericFunctionVectorMaterialTempl(const InputParameters ¶meters)
void computeQpFunctions()
A helper method for evaluating the functions.
Real value(unsigned n, unsigned alpha, unsigned beta, Real x)
static InputParameters validParams()
This material automatically declares as material properties whatever is passed to it through the para...
Materials compute MaterialProperties.
std::vector< GenericMaterialProperty< RealVectorValue, is_ad > * > _properties
Vector of all the properties.
const Function & getFunctionByName(const FunctionName &name) const
Get a function with a given name.
std::vector< std::string > _prop_names
Names of the vector material properties to define.
std::vector< const Function * > _functions
Vector of pointers to the functions, stored here after retrieval using their name.
IntRange< T > make_range(T beg, T end)
void mooseError(Args &&... args) const
Emits an error prefixed with object name and type.