https://mooseframework.inl.gov
Loading...
Searching...
No Matches
ADComputeSmallStrain.C
Go to the documentation of this file.
1//* This file is part of the MOOSE framework
2//* https://mooseframework.inl.gov
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 "RankTwoTensor.h"
13#include "libmesh/quadrature.h"
14
17
18template <typename R2>
21{
23 params.addClassDescription("Compute a small strain.");
24 return params;
25}
26
27template <typename R2>
32
33template <typename R2>
34void
36{
37 ADReal volumetric_strain = 0.0;
38
39 for (_qp = 0; _qp < _qrule->n_points(); ++_qp)
40 {
41 // strain = (grad_disp + grad_disp^R2)/2
43 (*_grad_disp[0])[_qp], (*_grad_disp[1])[_qp], (*_grad_disp[2])[_qp]);
44
45 if (_volumetric_locking_correction)
46 volumetric_strain += _total_strain[_qp].trace() * _JxW[_qp] * _coord[_qp];
47 }
48
49 if (_volumetric_locking_correction)
50 volumetric_strain /= _current_elem_volume;
51
52 for (_qp = 0; _qp < _qrule->n_points(); ++_qp)
53 {
54 if (_volumetric_locking_correction)
55 {
56 ADReal correction = (volumetric_strain - _total_strain[_qp].trace()) / 3.0;
57 _total_strain[_qp].addIa(correction);
58 }
59
60 if (_global_strain)
61 _total_strain[_qp] += (*_global_strain)[_qp];
62
63 _mechanical_strain[_qp] = _total_strain[_qp];
64
65 // Remove the Eigen strain
66 for (auto es : _eigenstrains)
67 _mechanical_strain[_qp] -= (*es)[_qp];
68 }
69}
70
registerMooseObject("SolidMechanicsApp", ADComputeSmallStrain)
DualNumber< Real, DNDerivativeType, true > ADReal
ADComputeSmallStrain defines a strain tensor, assuming small strains.
static InputParameters validParams()
virtual void computeProperties() override
ADComputeSmallStrainTempl(const InputParameters &parameters)
ADComputeStrainBase is the base class for strain tensors.
static InputParameters validParams()
void addClassDescription(const std::string &doc_string)