www.mooseframework.org
ADComputeIncrementalStrainBase.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 #include "RankTwoTensor.h"
13 #include "RankFourTensor.h"
14 #include "SymmetricRankTwoTensor.h"
16 
17 template <typename R2>
20 {
22  return params;
23 }
24 
25 template <typename R2>
27  const InputParameters & parameters)
28  : ADComputeStrainBaseTempl<R2>(parameters),
29  _grad_disp_old(3),
30  _strain_rate(this->template declareADProperty<R2>(_base_name + "strain_rate")),
31  _strain_increment(this->template declareADProperty<R2>(_base_name + "strain_increment")),
32  _rotation_increment(
33  this->template declareADProperty<RankTwoTensor>(_base_name + "rotation_increment")),
34  _mechanical_strain_old(
35  this->template getMaterialPropertyOld<R2>(_base_name + "mechanical_strain")),
36  _total_strain_old(this->template getMaterialPropertyOld<R2>(_base_name + "total_strain")),
37  _eigenstrains_old(_eigenstrain_names.size())
38 {
39  for (unsigned int i = 0; i < _eigenstrains_old.size(); ++i)
40  _eigenstrains_old[i] = &this->template getMaterialPropertyOld<R2>(_eigenstrain_names[i]);
41 }
42 
43 template <typename R2>
44 void
46 {
48  for (unsigned int i = 0; i < 3; ++i)
49  {
50  if (this->_fe_problem.isTransient() && i < _ndisp)
51  _grad_disp_old[i] = &this->coupledGradientOld("displacements", i);
52  else
53  _grad_disp_old[i] = &_grad_zero;
54  }
55 }
56 
57 template <typename R2>
58 void
60 {
61  _mechanical_strain[_qp].zero();
62  _total_strain[_qp].zero();
63 }
64 
65 template <typename R2>
66 void
68 {
69  for (unsigned int i = 0; i < _eigenstrains.size(); ++i)
70  {
71  strain -= (*_eigenstrains[i])[_qp];
72  strain += (*_eigenstrains_old[i])[_qp];
73  }
74 }
75 
ADComputeIncrementalStrainBaseTempl(const InputParameters &parameters)
std::vector< const MaterialProperty< R2 > * > _eigenstrains_old
ADComputeIncrementalStrainBase is the base class for strain tensors using incremental formulations...
ADComputeStrainBase is the base class for strain tensors.
static InputParameters validParams()
std::vector< MaterialPropertyName > _eigenstrain_names