www.mooseframework.org
GenericConstantRankTwoTensor.C
Go to the documentation of this file.
1 /****************************************************************/
2 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
3 /* */
4 /* All contents are licensed under LGPL V2.1 */
5 /* See LICENSE for full restrictions */
6 /****************************************************************/
7 
9 
10 template <>
13 {
15  params.addRequiredParam<std::vector<Real>>(
16  "tensor_values", "Vector of values defining the constant rank two tensor");
17  params.addRequiredParam<MaterialPropertyName>(
18  "tensor_name", "Name of the tensor material property to be created");
19  return params;
20 }
21 
23  : Material(parameters),
24  _prop(declareProperty<RankTwoTensor>(getParam<MaterialPropertyName>("tensor_name")))
25 {
26  _tensor.fillFromInputVector(getParam<std::vector<Real>>("tensor_values"));
27 }
28 
29 void
31 {
32  _prop[_qp] = _tensor;
33 }
void fillFromInputVector(const std::vector< Real > &input, FillMethod fill_method=autodetect)
fillFromInputVector takes 6 or 9 inputs to fill in the Rank-2 tensor.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
void addRequiredParam(const std::string &name, const std::string &doc_string)
This method adds a parameter and documentation string to the InputParameters object that will be extr...
unsigned int _qp
Definition: Material.h:220
RankTwoTensor is designed to handle the Stress or Strain Tensor for a fully anisotropic material...
Definition: RankTwoTensor.h:45
const T & getParam(const std::string &name) const
Retrieve a parameter for the object.
Definition: MooseObject.h:122
Materials compute MaterialProperties.
Definition: Material.h:53
virtual void computeQpProperties() override
Users must override this method.
GenericConstantRankTwoTensor(const InputParameters &parameters)
InputParameters validParams< GenericConstantRankTwoTensor >()
InputParameters validParams< Material >()
Definition: Material.C:27
MaterialProperty< RankTwoTensor > & _prop