11 #include "MooseMesh.h"
20 params.addRequiredCoupledVar(
22 "The displacements appropriate for the simulation geometry and coordinate system");
23 params.addParam<std::string>(
"base_name",
24 "Optional parameter that allows the user to define "
25 "multiple mechanics material systems on the same "
26 "block, i.e. for multiple phases");
27 params.addParam<
bool>(
28 "volumetric_locking_correction",
false,
"Flag to correct volumetric locking");
29 params.addParam<std::vector<MaterialPropertyName>>(
30 "eigenstrain_names",
"List of eigenstrains to be applied in this strain calculation");
31 params.addParam<MaterialPropertyName>(
"global_strain",
32 "Optional material property holding a global strain "
33 "tensor applied to the mesh as a whole");
34 params.suppressParameter<
bool>(
"use_displaced_mesh");
39 : DerivativeMaterialInterface<Material>(parameters),
40 _ndisp(coupledComponents(
"displacements")),
43 _base_name(isParamValid(
"base_name") ? getParam<std::string>(
"base_name") +
"_" :
""),
44 _mechanical_strain(declareProperty<
RankTwoTensor>(_base_name +
"mechanical_strain")),
45 _total_strain(declareProperty<
RankTwoTensor>(_base_name +
"total_strain")),
46 _eigenstrain_names(getParam<std::vector<MaterialPropertyName>>(
"eigenstrain_names")),
47 _eigenstrains(_eigenstrain_names.size()),
48 _global_strain(isParamValid(
"global_strain")
49 ? &getMaterialProperty<
RankTwoTensor>(_base_name +
"global_strain")
51 _volumetric_locking_correction(getParam<bool>(
"volumetric_locking_correction") &&
52 !isBoundaryMaterial()),
53 _current_elem_volume(_assembly.elemVolume())
62 paramError(
"volumetric_locking_correction",
"has to be set to false for 1-D problems.");
64 if (getParam<bool>(
"use_displaced_mesh"))
65 paramError(
"use_displaced_mesh",
"The strain calculator needs to run on the undisplaced mesh.");
69 mooseWarning(
"Volumetric locking correction is not required for second order elements. Using "
70 "volumetric locking with second order elements could cause zigzag patterns in "
71 "stresses and strains.");
79 for (
unsigned int i = 0; i <
_ndisp; ++i)
81 _disp[i] = &coupledValue(
"displacements", i);
82 _grad_disp[i] = &coupledGradient(
"displacements", i);
86 for (
unsigned i =
_ndisp; i < 3; ++i)
97 if (
_ndisp != _mesh.dimension())
100 "The number of variables supplied in 'displacements' must match the mesh dimension.");