23 "The displacements appropriate for the simulation geometry and coordinate system. If " 24 "displacements are not coupled, a different material class such as GenericMaterialProperty " 25 "or ParsedMaterial should be used.");
27 params.
addParam<std::string>(
"base_name",
28 "Optional parameter that allows the user to define " 29 "multiple material systems on the same block, " 30 "e.g. for multiple phases");
32 "Material property for strain-free density");
41 _coord_system(getBlockCoordSystem()),
42 _disp_r(this->template coupledGenericValue<is_ad>(
"displacements", 0)),
43 _base_name(isParamValid(
"base_name") ? getParam<
std::string>(
"base_name") +
"_" :
""),
45 this->template getGenericMaterialProperty<
Real, is_ad>(
"strain_free_density")),
46 _grad_disp(this->template coupledGenericGradients<is_ad>(
"displacements")),
47 _density(declareGenericProperty<
Real, is_ad>(_base_name +
"density"))
49 if (getParam<bool>(
"use_displaced_mesh"))
51 "StrainAdjustedDensity needs to act on an undisplaced mesh. Use of a displaced mesh " 53 "incorrect gradient values");
56 _grad_disp.resize(3, &genericZeroGradient<is_ad>());
63 computeQpProperties();
71 (*_grad_disp[0])[_qp], (*_grad_disp[1])[_qp], (*_grad_disp[2])[_qp]);
74 switch (_coord_system)
80 if (_q_point[_qp](0) != 0.0)
81 A(2, 2) = _disp_r[_qp] / _q_point[_qp](0) + 1.0;
85 if (_q_point[_qp](0) != 0.0)
86 A(1, 1) =
A(2, 2) = _disp_r[_qp] / _q_point[_qp](0) + 1.0;
90 _density[_qp] = _strain_free_density[_qp] /
A.det();
virtual void computeQpProperties() override
Compute density depending on strains from deforming mesh.
StrainAdjustedDensityTempl(const InputParameters ¶ms)
static InputParameters validParams()
static InputParameters validParams()
void paramError(const std::string ¶m, Args... args) const
std::vector< const GenericVariableGradient< is_ad > * > _grad_disp
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
registerMooseObject("SolidMechanicsApp", StrainAdjustedDensity)
virtual void initQpStatefulProperties() override
Moose::GenericType< RankTwoTensor, is_ad > GenericRankTwoTensor