44 _total_strain_base_name(this->isParamValid(
"total_strain_base_name")
45 ? this->template getParam<
std::string>(
"total_strain_base_name") +
48 _strain_increment(this->template getGenericMaterialProperty<
RankTwoTensor, is_ad>(
49 _total_strain_base_name +
"strain_increment")),
50 _effective_inelastic_strain(this->template declareGenericProperty<Real, is_ad>(
51 _base_name +
"effective_" + this->template getParam<
std::string>(
"inelastic_strain_name"))),
52 _effective_inelastic_strain_old(this->template getMaterialPropertyOld<Real>(
53 _base_name +
"effective_" + this->template getParam<
std::string>(
"inelastic_strain_name"))),
54 _inelastic_strain(this->template declareGenericProperty<
RankTwoTensor, is_ad>(
55 _base_name + this->template getParam<
std::string>(
"inelastic_strain_name"))),
56 _inelastic_strain_old(this->template getMaterialPropertyOld<
RankTwoTensor>(
57 _base_name + this->template getParam<
std::string>(
"inelastic_strain_name"))),
58 _max_inelastic_increment(this->template getParam<Real>(
"max_inelastic_increment")),
59 _intermediate_porosity(0.0),
60 _porosity_old(this->template getMaterialPropertyOld<Real>(
"porosity_name")),
61 _verbose(this->template getParam<bool>(
"verbose")),
62 _initial_porosity(this->template getParam<Real>(
"initial_porosity")),
63 _negative_behavior(this->template getParam<
MooseEnum>(
"negative_behavior")
107 _intermediate_porosity =
108 (1.0 - _porosity_old[_qp]) * (_strain_increment[_qp] - elastic_strain_increment).trace() +
111 if (_intermediate_porosity < 0.0)
113 if (_negative_behavior == NegativeBehavior::ZERO)
114 _intermediate_porosity = 0.0;
115 if (_negative_behavior == NegativeBehavior::INITIAL_CONDITION)
116 _intermediate_porosity = _initial_porosity;
117 if (_negative_behavior == NegativeBehavior::EXCEPTION)
118 mooseException(
"In ", _name,
": porosity is negative.");
122 if (isnan(_intermediate_porosity))
123 mooseException(
"In ", _name,
": porosity is nan. Cutting timestep.");