www.mooseframework.org
ComputeVariableBaseEigenStrain.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
11 
13 
16 {
18  params.addClassDescription("Computes Eigenstrain based on material property tensor base");
19  params.addRequiredParam<MaterialPropertyName>("base_tensor_property_name",
20  "Name of base tensor property");
21  params.addParam<MaterialPropertyName>(
22  "prefactor", 1.0, "Name of material defining the variable dependence");
23  params.addParam<std::vector<Real>>(
24  "offset_tensor", "Vector of values defining the constant base tensor for the Eigenstrain");
25  return params;
26 }
27 
29  : ComputeEigenstrainBase(parameters),
30  _base_tensor(getMaterialProperty<RealTensorValue>("base_tensor_property_name")),
31  _prefactor(getMaterialProperty<Real>("prefactor"))
32 {
33  if (isParamValid("offset_tensor"))
34  _offset_tensor.fillFromInputVector(getParam<std::vector<Real>>("offset_tensor"));
35  else
37 }
38 
39 void
41 {
42  RankTwoTensor base_rank_two_tensor = _base_tensor[_qp];
43  _eigenstrain[_qp] = base_rank_two_tensor * _prefactor[_qp] + _offset_tensor;
44 }
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
registerMooseObject("SolidMechanicsApp", ComputeVariableBaseEigenStrain)
virtual void computeQpEigenstrain()
Compute the eigenstrain and store in _eigenstrain.
void addRequiredParam(const std::string &name, const std::string &doc_string)
bool isParamValid(const std::string &name) const
unsigned int _qp
TensorValue< Real > RealTensorValue
void fillFromInputVector(const std::vector< Real > &input, FillMethod fill_method=autodetect)
static InputParameters validParams()
const MaterialProperty< Real > & _prefactor
const T & getParam(const std::string &name) const
ComputeEigenstrainBase is the base class for eigenstrain tensors.
ComputeVariableBaseEigenStrain(const InputParameters &parameters)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
ComputeVariableBaseEigenstrain computes an Eigenstrain based on a real tensor value material property...
GenericMaterialProperty< RankTwoTensor, is_ad > & _eigenstrain
Stores the current total eigenstrain.
void addClassDescription(const std::string &doc_string)
const MaterialProperty< RealTensorValue > & _base_tensor