22 "prescribed by input parameters.");
24 "prop_names",
"The names of the properties this material will have");
26 "prop_values",
"The values associated with the named properties. ");
36 _prop_names(getParam<
std::vector<
std::string>>(
"prop_names")),
37 _prop_values(getParam<
std::vector<
std::vector<
Real>>>(
"prop_values"))
41 if (num_names != num_values)
43 "Number of vector property names (" + std::to_string(num_names) +
44 ") does not match the number of vectors of property values (" +
45 std::to_string(num_values) +
")");
58 computeQpProperties();
65 for (
unsigned int i = 0; i < _num_props; i++)
67 auto & prop_out = (*_properties[i])[_qp];
68 const auto & prop_in = _prop_values[i];
69 prop_out.resize(prop_in.size());
71 prop_out[j] = prop_in[j];
78 const MaterialPropertyName & prop_name)
const 81 if (_prop_names[i] == prop_name)
82 return _prop_values[i].size();
83 paramError(
"prop_names",
"Property '" + prop_name +
"' was not defined");
void paramError(const std::string ¶m, Args... args) const
Emits an error prefixed with the file and line number of the given param (from the input file) along ...
const std::vector< std::string > & _prop_names
The names of the constant vector material properties.
virtual void initQpStatefulProperties() override
Initialize stateful properties at quadrature points.
const std::vector< std::vector< Real > > & _prop_values
The vector values of each vector material property.
static InputParameters validParams()
std::vector< GenericMaterialProperty< std::vector< Real >, is_ad > * > _properties
A vector of pointers to the material properties.
static InputParameters validParams()
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
registerMooseObject("MooseApp", GenericConstantStdVectorMaterial)
virtual void computeQpProperties() override
Users must override this method.
Material to create constant properties with the variable-size std::vector<Real> type.
virtual std::size_t getVectorPropertySize(const MaterialPropertyName &prop_name) const override
Return the size of the variable size vector material property that the material defines.
GenericConstantStdVectorMaterialTempl(const InputParameters ¶meters)
Materials compute MaterialProperties.
Interface class to return the size of material properties that do not have a fixed size...
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
IntRange< T > make_range(T beg, T end)
std::size_t _num_props
The number of constant vector material properties defined.
auto index_range(const T &sizable)