16 template <
typename R2>
23 "The displacements appropriate for the simulation geometry and coordinate system");
24 params.
addParam<std::string>(
"base_name",
25 "Optional parameter that allows the user to define " 26 "multiple mechanics material systems on the same " 27 "block, i.e. for multiple phases");
29 "volumetric_locking_correction",
false,
"Flag to correct volumetric locking");
30 params.
addParam<std::vector<MaterialPropertyName>>(
31 "eigenstrain_names", {},
"List of eigenstrains to be applied in this strain calculation");
32 params.
addParam<MaterialPropertyName>(
"global_strain",
33 "Optional material property holding a global strain " 34 "tensor applied to the mesh as a whole");
39 template <
typename R2>
42 _ndisp(coupledComponents(
"displacements")),
43 _disp(adCoupledValues(
"displacements")),
44 _grad_disp(adCoupledGradients(
"displacements")),
45 _base_name(isParamValid(
"base_name") ? getParam<
std::string>(
"base_name") +
"_" :
""),
46 _mechanical_strain(declareADProperty<R2>(_base_name +
"mechanical_strain")),
47 _total_strain(declareADProperty<R2>(_base_name +
"total_strain")),
48 _eigenstrain_names(getParam<
std::vector<MaterialPropertyName>>(
"eigenstrain_names")),
49 _eigenstrains(_eigenstrain_names.size()),
50 _global_strain(isParamValid(
"global_strain")
51 ? &getADMaterialProperty<R2>(_base_name +
"global_strain")
53 _volumetric_locking_correction(getParam<bool>(
"volumetric_locking_correction") &&
54 !this->isBoundaryMaterial()),
55 _current_elem_volume(_assembly.elemVolume())
58 for (
unsigned i =
_ndisp; i < 3; ++i)
71 paramError(
"volumetric_locking_correction",
"has to be set to false for 1-D problems.");
73 if (getParam<bool>(
"use_displaced_mesh"))
74 paramError(
"use_displaced_mesh",
"The strain calculator needs to run on the undisplaced mesh.");
77 template <
typename R2>
81 displacementIntegrityCheck();
84 template <
typename R2>
89 if (_ndisp != _mesh.dimension())
92 "The number of variables supplied in 'displacements' must match the mesh dimension.");
95 template <
typename R2>
99 _mechanical_strain[_qp].zero();
100 _total_strain[_qp].zero();
const unsigned int _ndisp
Coupled displacement variables.
const MooseArray< ADRealVectorValue > & _ad_grad_zero
const MooseArray< DualReal > & _ad_zero
virtual void initQpStatefulProperties() override
ADComputeStrainBase is the base class for strain tensors.
std::vector< const ADVariableGradient * > _grad_disp
Gradient of displacements.
static InputParameters validParams()
void initialSetup() override
static InputParameters validParams()
std::vector< const ADMaterialProperty< R2 > * > _eigenstrains
const bool _volumetric_locking_correction
void paramError(const std::string ¶m, Args... args) const
ADComputeStrainBaseTempl(const InputParameters ¶meters)
const std::string _base_name
Base name of the material system.
std::vector< const ADVariableValue * > _disp
Displacement variables.
virtual void displacementIntegrityCheck()
std::vector< MaterialPropertyName > _eigenstrain_names