21 "Declares material properties based on names and values prescribed by input parameters.");
23 "prop_names",
"The names of the properties this material will have");
25 "The values associated with the named properties");
35 _prop_names(getParam<
std::vector<
std::string>>(
"prop_names")),
36 _prop_values(getParam<
std::vector<Real>>(
"prop_values"))
41 if (num_names != num_values)
43 "Number of prop_names must match the number of prop_values for a GenericConstantMaterial!");
57 computeQpProperties();
64 for (
unsigned int i = 0; i < _num_props; i++)
65 (*_properties[i])[_qp] = _prop_values[i];
registerMooseObject("MooseApp", GenericConstantMaterial)
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application.
This material automatically declares as material properties whatever is passed to it through the para...
static InputParameters validParams()
const std::vector< Real > & _prop_values
const std::vector< std::string > & _prop_names
std::vector< GenericMaterialProperty< Real, is_ad > * > _properties
GenericConstantMaterialTempl(const InputParameters ¶meters)
virtual void computeQpProperties() override
Users must override this method.
virtual void initQpStatefulProperties() override
Initialize stateful properties at quadrature points.
Materials compute MaterialProperties.
static InputParameters validParams()
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...