www.mooseframework.org
ComputeSmallStrain.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 "ComputeSmallStrain.h"
9 #include "Assembly.h"
10 #include "libmesh/quadrature.h"
11 
12 template <>
13 InputParameters
15 {
16  InputParameters params = validParams<ComputeStrainBase>();
17  params.addClassDescription("Compute a small strain.");
18  return params;
19 }
20 
21 ComputeSmallStrain::ComputeSmallStrain(const InputParameters & parameters)
22  : ComputeStrainBase(parameters)
23 {
24 }
25 
26 void
28 {
29  Real volumetric_strain = 0.0;
30  for (_qp = 0; _qp < _qrule->n_points(); ++_qp)
31  {
32  // strain = (grad_disp + grad_disp^T)/2
33  RankTwoTensor grad_tensor((*_grad_disp[0])[_qp], (*_grad_disp[1])[_qp], (*_grad_disp[2])[_qp]);
34 
35  _total_strain[_qp] = (grad_tensor + grad_tensor.transpose()) / 2.0;
36 
38  volumetric_strain += _total_strain[_qp].trace() * _JxW[_qp] * _coord[_qp];
39  }
40 
42  volumetric_strain /= _current_elem_volume;
43 
44  for (_qp = 0; _qp < _qrule->n_points(); ++_qp)
45  {
47  {
48  Real trace = _total_strain[_qp].trace();
49  _total_strain[_qp](0, 0) += (volumetric_strain - trace) / 3.0;
50  _total_strain[_qp](1, 1) += (volumetric_strain - trace) / 3.0;
51  _total_strain[_qp](2, 2) += (volumetric_strain - trace) / 3.0;
52  }
53 
55 
56  // Remove the Eigen strain
57  for (auto es : _eigenstrains)
58  _mechanical_strain[_qp] -= (*es)[_qp];
59  }
60 }
InputParameters validParams< ComputeSmallStrain >()
const Real & _current_elem_volume
ComputeSmallStrain(const InputParameters &parameters)
MaterialProperty< RankTwoTensor > & _mechanical_strain
virtual void computeProperties() override
ComputeStrainBase is the base class for strain tensors.
MaterialProperty< RankTwoTensor > & _total_strain
std::vector< const MaterialProperty< RankTwoTensor > * > _eigenstrains
InputParameters validParams< ComputeStrainBase >()
std::vector< const VariableGradient * > _grad_disp