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]);
RankTwoTensorFromComponentProperties(const InputParameters ¶meters)
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 ...
static InputParameters validParams()
MaterialProperty< RankTwoTensor > & _prop
RankTwoTensor material property.
std::vector< const MaterialProperty< Real > * > _mat_props
Vector of material properties, inner ordering is tensor columns, outer is rows.
virtual void computeQpProperties() override
Users must override this method.
registerMooseObject("MooseApp", RankTwoTensorFromComponentProperties)
static InputParameters validParams()
Materials compute MaterialProperties.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
IntRange< T > make_range(T beg, T end)
Assembles a RankTwoTensor from scalar material properties or constants.
bool parsesToReal(const std::string &input, Real *parsed_real)
std::vector< Real > _const_vals
Constant values in the tensor property.
std::vector< bool > _is_const
Keeps track of which component is a constant.