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

ADADComputeStrainBase is the base class for strain tensors. More...

#include <ADComputeStrainBase.h>

Inheritance diagram for ADComputeStrainBase< compute_stage >:
[legend]

Public Member Functions

 ADComputeStrainBase (const InputParameters &parameters)
 

Protected Member Functions

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

Protected Attributes

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 ADComputeStrainBase< compute_stage >

ADADComputeStrainBase is the base class for strain tensors.

Definition at line 31 of file ADComputeStrainBase.h.

Constructor & Destructor Documentation

◆ ADComputeStrainBase()

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

Definition at line 36 of file ADComputeStrainBase.C.

37  : ADMaterial<compute_stage>(parameters),
38  _ndisp(coupledComponents("displacements")),
39  _disp(3),
40  _grad_disp(3),
41  _base_name(isParamValid("base_name") ? adGetParam<std::string>("base_name") + "_" : ""),
42  _mechanical_strain(adDeclareADProperty<RankTwoTensor>(_base_name + "mechanical_strain")),
43  _total_strain(adDeclareADProperty<RankTwoTensor>(_base_name + "total_strain")),
44  _eigenstrain_names(adGetParam<std::vector<MaterialPropertyName>>("eigenstrain_names")),
46  _global_strain(isParamValid("global_strain")
47  ? &adGetADMaterialProperty<RankTwoTensor>(_base_name + "global_strain")
48  : nullptr),
49  _volumetric_locking_correction(adGetParam<bool>("volumetric_locking_correction")),
50  _current_elem_volume(_assembly.elemVolume())
51 {
52  for (unsigned int i = 0; i < _eigenstrains.size(); ++i)
53  {
55  _eigenstrains[i] = &adGetADMaterialProperty<RankTwoTensor>(_eigenstrain_names[i]);
56  }
57 
59  paramError("volumetric_locking_correction", "has to be set to false for 1-D problems.");
60 
61  if (adGetParam<bool>("use_displaced_mesh"))
62  paramError("use_displaced_mesh", "The strain calculator needs to run on the undisplaced mesh.");
63 }
std::vector< const ADMaterialProperty(RankTwoTensor) * > _eigenstrains
const bool _volumetric_locking_correction
const unsigned int _ndisp
Coupled displacement variables.
const Real & _current_elem_volume
std::vector< const ADVariableValue * > _disp
std::vector< MaterialPropertyName > _eigenstrain_names
std::vector< const ADVariableGradient * > _grad_disp

Member Function Documentation

◆ ADMaterialProperty() [1/3]

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

◆ ADMaterialProperty() [2/3]

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

◆ ADMaterialProperty() [3/3]

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

◆ displacementIntegrityCheck()

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

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 ( )
overrideprotected

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] = &adZero();
81  _grad_disp[i] = &adGradZero();
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 ( )
overrideprotectedvirtual

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
protected

◆ _current_elem_volume

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

Definition at line 69 of file ADComputeStrainBase.h.

◆ _disp

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

Definition at line 55 of file ADComputeStrainBase.h.

◆ _eigenstrain_names

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

◆ _eigenstrains

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

◆ _grad_disp

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

Definition at line 56 of file ADComputeStrainBase.h.

◆ _ndisp

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

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
protected

◆ usingMaterialMembers

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

Definition at line 71 of file ADComputeStrainBase.h.


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