www.mooseframework.org
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
ADComputeSmallStrain< compute_stage > Class Template Reference

ADComputeSmallStrain defines a strain tensor, assuming small strains. More...

#include <ADComputeSmallStrain.h>

Inheritance diagram for ADComputeSmallStrain< compute_stage >:
[legend]

Public Member Functions

 ADComputeSmallStrain (const InputParameters &parameters)
 
virtual void computeProperties () override
 
void initialSetup () override
 

Protected Member Functions

virtual void initQpStatefulProperties () override
 
virtual void displacementIntegrityCheck ()
 
 ADMaterialProperty (RankTwoTensor) &_mechanical_strain
 
 ADMaterialProperty (RankTwoTensor) &_total_strain
 
const ADMaterialProperty (RankTwoTensor) *_global_strain
 

Protected Attributes

 usingComputeStrainBaseMembers
 
const unsigned int _ndisp
 Coupled displacement variables. More...
 
std::vector< const ADVariableValue * > _disp
 
std::vector< const ADVariableGradient * > _grad_disp
 
std::string _base_name
 
std::vector< MaterialPropertyName > _eigenstrain_names
 
std::vector< const ADMaterialProperty(RankTwoTensor) * > _eigenstrains
 
const bool _volumetric_locking_correction
 
const Real & _current_elem_volume
 
 usingMaterialMembers
 

Detailed Description

template<ComputeStage compute_stage>
class ADComputeSmallStrain< compute_stage >

ADComputeSmallStrain defines a strain tensor, assuming small strains.

Definition at line 17 of file ADComputeSmallStrain.h.

Constructor & Destructor Documentation

◆ ADComputeSmallStrain()

template<ComputeStage compute_stage>
ADComputeSmallStrain< compute_stage >::ADComputeSmallStrain ( const InputParameters &  parameters)

Definition at line 20 of file ADComputeSmallStrain.C.

22 {
23 }
ADADComputeStrainBase is the base class for strain tensors.

Member Function Documentation

◆ ADMaterialProperty() [1/3]

template<ComputeStage compute_stage>
ADComputeStrainBase< compute_stage >::ADMaterialProperty ( RankTwoTensor  ) &
protectedinherited

◆ ADMaterialProperty() [2/3]

template<ComputeStage compute_stage>
ADComputeStrainBase< compute_stage >::ADMaterialProperty ( RankTwoTensor  ) &
protectedinherited

◆ ADMaterialProperty() [3/3]

template<ComputeStage compute_stage>
const ADComputeStrainBase< compute_stage >::ADMaterialProperty ( RankTwoTensor  )
protectedinherited

◆ computeProperties()

template<ComputeStage compute_stage>
void ADComputeSmallStrain< compute_stage >::computeProperties ( )
overridevirtual

Reimplemented in ADCompute2DSmallStrain< compute_stage >, ADCompute1DSmallStrain< compute_stage >, and ADComputeRSphericalSmallStrain< compute_stage >.

Definition at line 27 of file ADComputeSmallStrain.C.

28 {
29  ADReal volumetric_strain = 0.0;
30 
31  for (_qp = 0; _qp < _qrule->n_points(); ++_qp)
32  {
33  // strain = (grad_disp + grad_disp^T)/2
34  ADRankTwoTensor grad_tensor(
35  (*_grad_disp[0])[_qp], (*_grad_disp[1])[_qp], (*_grad_disp[2])[_qp]);
36 
37  _total_strain[_qp] = (grad_tensor + grad_tensor.transpose()) / 2.0;
38 
40  volumetric_strain += _total_strain[_qp].trace() * _JxW[_qp] * _coord[_qp];
41  }
42 
44  volumetric_strain /= _current_elem_volume;
45 
46  for (_qp = 0; _qp < _qrule->n_points(); ++_qp)
47  {
49  {
50  ADReal correction = (volumetric_strain - _total_strain[_qp].trace()) / 3.0;
51  _total_strain[_qp](0, 0) += correction;
52  _total_strain[_qp](1, 1) += correction;
53  _total_strain[_qp](2, 2) += correction;
54  }
55 
56  if (_global_strain)
57  _total_strain[_qp] += (*_global_strain)[_qp];
58 
59  _mechanical_strain[_qp] = _total_strain[_qp];
60 
61  // Remove the Eigen strain
62  for (auto es : _eigenstrains)
63  _mechanical_strain[_qp] -= (*es)[_qp];
64  }
65 
66  copyDualNumbersToValues();
67 }
std::vector< const ADMaterialProperty(RankTwoTensor) * > _eigenstrains
const bool _volumetric_locking_correction
const Real & _current_elem_volume
std::vector< const ADVariableGradient * > _grad_disp

◆ displacementIntegrityCheck()

template<ComputeStage compute_stage>
void ADComputeStrainBase< compute_stage >::displacementIntegrityCheck ( )
protectedvirtualinherited

Reimplemented in ADCompute2DFiniteStrain< compute_stage >, ADCompute2DIncrementalStrain< compute_stage >, and ADCompute2DSmallStrain< compute_stage >.

Definition at line 87 of file ADComputeStrainBase.C.

88 {
89  // Checking for consistency between mesh size and length of the provided displacements vector
90  if (_ndisp != _mesh.dimension())
91  paramError(
92  "displacements",
93  "The number of variables supplied in 'displacements' must match the mesh dimension.");
94 }
const unsigned int _ndisp
Coupled displacement variables.

◆ initialSetup()

template<ComputeStage compute_stage>
void ADComputeStrainBase< compute_stage >::initialSetup ( )
overrideinherited

Definition at line 67 of file ADComputeStrainBase.C.

Referenced by ADComputeIncrementalStrainBase< compute_stage >::initialSetup().

68 {
70  // fetch coupled variables and gradients (as stateful properties if necessary)
71  for (unsigned int i = 0; i < _ndisp; ++i)
72  {
73  _disp[i] = &adCoupledValue("displacements", i);
74  _grad_disp[i] = &adCoupledGradient("displacements", i);
75  }
76 
77  // set unused dimensions to zero
78  for (unsigned i = _ndisp; i < 3; ++i)
79  {
80  _disp[i] = &adZeroValue();
81  _grad_disp[i] = &adZeroGradient();
82  }
83 }
const unsigned int _ndisp
Coupled displacement variables.
std::vector< const ADVariableValue * > _disp
std::vector< const ADVariableGradient * > _grad_disp
virtual void displacementIntegrityCheck()

◆ initQpStatefulProperties()

template<ComputeStage compute_stage>
void ADComputeStrainBase< compute_stage >::initQpStatefulProperties ( )
overrideprotectedvirtualinherited

Reimplemented in ADComputeIncrementalStrainBase< compute_stage >.

Definition at line 98 of file ADComputeStrainBase.C.

99 {
100  _mechanical_strain[_qp].zero();
101  _total_strain[_qp].zero();
102 }

Member Data Documentation

◆ _base_name

template<ComputeStage compute_stage>
std::string ADComputeStrainBase< compute_stage >::_base_name
protectedinherited

◆ _current_elem_volume

template<ComputeStage compute_stage>
const Real& ADComputeStrainBase< compute_stage >::_current_elem_volume
protectedinherited

Definition at line 69 of file ADComputeStrainBase.h.

◆ _disp

template<ComputeStage compute_stage>
std::vector<const ADVariableValue *> ADComputeStrainBase< compute_stage >::_disp
protectedinherited

Definition at line 55 of file ADComputeStrainBase.h.

◆ _eigenstrain_names

template<ComputeStage compute_stage>
std::vector<MaterialPropertyName> ADComputeStrainBase< compute_stage >::_eigenstrain_names
protectedinherited

◆ _eigenstrains

template<ComputeStage compute_stage>
std::vector<const ADMaterialProperty(RankTwoTensor) *> ADComputeStrainBase< compute_stage >::_eigenstrains
protectedinherited

◆ _grad_disp

template<ComputeStage compute_stage>
std::vector<const ADVariableGradient *> ADComputeStrainBase< compute_stage >::_grad_disp
protectedinherited

Definition at line 56 of file ADComputeStrainBase.h.

◆ _ndisp

template<ComputeStage compute_stage>
const unsigned int ADComputeStrainBase< compute_stage >::_ndisp
protectedinherited

Coupled displacement variables.

Definition at line 54 of file ADComputeStrainBase.h.

Referenced by ADComputeStrainBase< compute_stage >::ADComputeStrainBase().

◆ _volumetric_locking_correction

template<ComputeStage compute_stage>
const bool ADComputeStrainBase< compute_stage >::_volumetric_locking_correction
protectedinherited

◆ usingComputeStrainBaseMembers

template<ComputeStage compute_stage>
ADComputeSmallStrain< compute_stage >::usingComputeStrainBaseMembers
protected

Definition at line 33 of file ADComputeSmallStrain.h.

◆ usingMaterialMembers

template<ComputeStage compute_stage>
ADComputeStrainBase< compute_stage >::usingMaterialMembers
protectedinherited

Definition at line 71 of file ADComputeStrainBase.h.


The documentation for this class was generated from the following files: