www.mooseframework.org
ComputeIncrementalStrainBase.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 #include "MooseMesh.h"
12 
15 {
17  return params;
18 }
19 
21  : ComputeStrainBase(parameters),
22  _grad_disp_old(3),
23  _strain_rate(declareProperty<RankTwoTensor>(_base_name + "strain_rate")),
24  _strain_increment(declareProperty<RankTwoTensor>(_base_name + "strain_increment")),
25  _rotation_increment(declareProperty<RankTwoTensor>(_base_name + "rotation_increment")),
26  _deformation_gradient(declareProperty<RankTwoTensor>(_base_name + "deformation_gradient")),
27  _mechanical_strain_old(getMaterialPropertyOld<RankTwoTensor>(_base_name + "mechanical_strain")),
28  _total_strain_old(getMaterialPropertyOld<RankTwoTensor>(_base_name + "total_strain")),
29  _eigenstrains_old(_eigenstrain_names.size())
30 {
31  for (unsigned int i = 0; i < _eigenstrains_old.size(); ++i)
32  _eigenstrains_old[i] = &getMaterialPropertyOld<RankTwoTensor>(_eigenstrain_names[i]);
33 }
34 
35 void
37 {
39  for (unsigned int i = 0; i < 3; ++i)
40  {
41  if (_fe_problem.isTransient() && i < _ndisp)
42  _grad_disp_old[i] = &coupledGradientOld("displacements", i);
43  else
45  }
46 }
47 
48 void
50 {
51  _mechanical_strain[_qp].zero();
52  _total_strain[_qp].zero();
53  _deformation_gradient[_qp].setToIdentity();
54 }
55 
56 void
58 {
59  for (unsigned int i = 0; i < _eigenstrains.size(); ++i)
60  {
61  strain -= (*_eigenstrains[i])[_qp];
62  strain += (*_eigenstrains_old[i])[_qp];
63  }
64 }
MaterialProperty< RankTwoTensor > & _deformation_gradient
const VariableGradient & _grad_zero
virtual const VariableGradient & coupledGradientOld(const std::string &var_name, unsigned int comp=0) const
virtual void initQpStatefulProperties() override
MaterialProperty< RankTwoTensor > & _mechanical_strain
unsigned int _ndisp
Coupled displacement variables.
void initialSetup() override
void subtractEigenstrainIncrementFromStrain(RankTwoTensor &strain)
static InputParameters validParams()
std::vector< const VariableGradient * > _grad_disp_old
ComputeStrainBase is the base class for strain tensors.
ComputeIncrementalStrainBase(const InputParameters &parameters)
virtual bool isTransient() const override
std::vector< const MaterialProperty< RankTwoTensor > * > _eigenstrains_old
std::vector< MaterialPropertyName > _eigenstrain_names
MaterialProperty< RankTwoTensor > & _total_strain
std::vector< const MaterialProperty< RankTwoTensor > * > _eigenstrains