www.mooseframework.org
ComputeIncrementalStrainBase.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 #include "MooseMesh.h"
10 
11 template <>
12 InputParameters
14 {
15  InputParameters params = validParams<ComputeStrainBase>();
16  return params;
17 }
18 
20  : ComputeStrainBase(parameters),
21  _grad_disp_old(3),
22  _strain_rate(declareProperty<RankTwoTensor>(_base_name + "strain_rate")),
23  _strain_increment(declareProperty<RankTwoTensor>(_base_name + "strain_increment")),
24  _rotation_increment(declareProperty<RankTwoTensor>(_base_name + "rotation_increment")),
25  _deformation_gradient(declareProperty<RankTwoTensor>(_base_name + "deformation_gradient")),
26  _mechanical_strain_old(getMaterialPropertyOld<RankTwoTensor>(_base_name + "mechanical_strain")),
27  _total_strain_old(getMaterialPropertyOld<RankTwoTensor>(_base_name + "total_strain")),
28  _eigenstrains_old(_eigenstrain_names.size())
29 {
30  for (unsigned int i = 0; i < _eigenstrains_old.size(); ++i)
31  _eigenstrains_old[i] = &getMaterialPropertyOld<RankTwoTensor>(_eigenstrain_names[i]);
32 
33  // fetch coupled old displacement gradient, setting components for unused dimensions to zero
34  for (unsigned int i = 0; i < 3; ++i)
35  {
36  if (_fe_problem.isTransient() && i < _ndisp)
37  _grad_disp_old[i] = &coupledGradientOld("displacements", i);
38  else
39  _grad_disp_old[i] = &_grad_zero;
40  }
41 }
42 
43 void
45 {
46  _mechanical_strain[_qp].zero();
47  _total_strain[_qp].zero();
48  _deformation_gradient[_qp].zero();
49  _deformation_gradient[_qp].addIa(1.0);
50 
51  // Note that for some models (small strain), the rotation increment is
52  // never updated. Because we always have stateful properties, this method
53  // always gets called, so we can rely on this getting set here without
54  // setting it again when properties get computed.
55  _rotation_increment[_qp].zero();
56  _rotation_increment[_qp].addIa(1.0);
57 }
58 
59 void
61 {
62  for (unsigned int i = 0; i < _eigenstrains.size(); ++i)
63  {
64  strain -= (*_eigenstrains[i])[_qp];
65  strain += (*_eigenstrains_old[i])[_qp];
66  }
67 }
MaterialProperty< RankTwoTensor > & _deformation_gradient
virtual void initQpStatefulProperties() override
MaterialProperty< RankTwoTensor > & _mechanical_strain
unsigned int _ndisp
Coupled displacement variables.
void subtractEigenstrainIncrementFromStrain(RankTwoTensor &strain)
std::vector< const VariableGradient * > _grad_disp_old
ComputeStrainBase is the base class for strain tensors.
ComputeIncrementalStrainBase(const InputParameters &parameters)
MaterialProperty< RankTwoTensor > & _rotation_increment
std::vector< const MaterialProperty< RankTwoTensor > * > _eigenstrains_old
std::vector< MaterialPropertyName > _eigenstrain_names
InputParameters validParams< ComputeIncrementalStrainBase >()
MaterialProperty< RankTwoTensor > & _total_strain
std::vector< const MaterialProperty< RankTwoTensor > * > _eigenstrains
InputParameters validParams< ComputeStrainBase >()