19 "Assembles a RankTwoTensor from scalar material properties or constants");
20 params.
addParam<MaterialPropertyName>(
"tensor_name",
"Name of output tensor");
22 "tensor_values",
"9 tensor components (row-major) as material property names or constants");
29 _prop(declareProperty<
RankTwoTensor>(getParam<MaterialPropertyName>(
"tensor_name")))
31 const auto & vals = getParam<std::vector<std::string>>(
"tensor_values");
33 paramError(
"tensor_values",
"Must provide exactly 9 values");
39 for (
unsigned int i = 0; i < 9; ++i)
49 _mat_props[i] = &getMaterialProperty<Real>(vals[i]);
59 for (
const auto i : make_range(3))
60 for (
const auto j : make_range(3))
registerMooseObject("MooseApp", RankTwoTensorFromComponentProperties)
Materials compute MaterialProperties.
static InputParameters validParams()
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 ...
Assembles a RankTwoTensor from scalar material properties or constants.
std::vector< Real > _const_vals
Constant values in the tensor property.
MaterialProperty< RankTwoTensor > & _prop
RankTwoTensor material property.
std::vector< bool > _is_const
Keeps track of which component is a constant.
std::vector< const MaterialProperty< Real > * > _mat_props
Vector of material properties, inner ordering is tensor columns, outer is rows.
RankTwoTensorFromComponentProperties(const InputParameters ¶meters)
virtual void computeQpProperties() override
Users must override this method.
static InputParameters validParams()
bool parsesToReal(const std::string &input, Real *parsed_real)