www.mooseframework.org
Compute2DSmallStrain.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 
8 #include "Compute2DSmallStrain.h"
9 
10 #include "libmesh/quadrature.h"
11 
12 template <>
13 InputParameters
15 {
16  InputParameters params = validParams<ComputeSmallStrain>();
17  params.addClassDescription("Compute a small strain in a plane strain configuration.");
18  return params;
19 }
20 
21 Compute2DSmallStrain::Compute2DSmallStrain(const InputParameters & parameters)
22  : ComputeSmallStrain(parameters)
23 {
24 }
25 
26 void
28 {
29  Real volumetric_strain = 0.0;
30  for (_qp = 0; _qp < _qrule->n_points(); ++_qp)
31  {
32  _total_strain[_qp](0, 0) = (*_grad_disp[0])[_qp](0);
33  _total_strain[_qp](1, 1) = (*_grad_disp[1])[_qp](1);
34  _total_strain[_qp](0, 1) = ((*_grad_disp[0])[_qp](1) + (*_grad_disp[1])[_qp](0)) / 2.0;
35  _total_strain[_qp](1, 0) = _total_strain[_qp](0, 1); // force the symmetrical strain tensor
36  _total_strain[_qp](2, 2) = computeStrainZZ();
37 
39  volumetric_strain += _total_strain[_qp].trace() * _JxW[_qp] * _coord[_qp];
40  }
41 
43  volumetric_strain /= _current_elem_volume;
44 
45  for (_qp = 0; _qp < _qrule->n_points(); ++_qp)
46  {
48  {
49  Real trace = _total_strain[_qp].trace();
50  _total_strain[_qp](0, 0) += (volumetric_strain - trace) / 3.0;
51  _total_strain[_qp](1, 1) += (volumetric_strain - trace) / 3.0;
52  _total_strain[_qp](2, 2) += (volumetric_strain - trace) / 3.0;
53  }
54 
56 
57  // Remove the eigenstrains
58  for (auto es : _eigenstrains)
59  _mechanical_strain[_qp] -= (*es)[_qp];
60  }
61 }
InputParameters validParams< ComputeSmallStrain >()
const Real & _current_elem_volume
virtual void computeProperties() override
virtual Real computeStrainZZ()=0
MaterialProperty< RankTwoTensor > & _mechanical_strain
InputParameters validParams< Compute2DSmallStrain >()
Compute2DSmallStrain(const InputParameters &parameters)
MaterialProperty< RankTwoTensor > & _total_strain
std::vector< const MaterialProperty< RankTwoTensor > * > _eigenstrains
ComputeSmallStrain defines a strain tensor, assuming small strains.
std::vector< const VariableGradient * > _grad_disp