46 auto const& eps_m = std::get<MPL::SymmetricTensor<DisplacementDim>>(
48 auto const& eps_m_prev = std::get<MPL::SymmetricTensor<DisplacementDim>>(
50 auto const& sigma_prev = std::get<MPL::SymmetricTensor<DisplacementDim>>(
51 variable_array_prev.
stress);
56 Eigen::FullPivLU<Eigen::Matrix<double, KelvinVectorSize, KelvinVectorSize,
60 const auto C = this->getElasticTensor(t, x, T);
61 KelvinVector sigma_try = sigma_prev + C * (eps_m - eps_m_prev);
63 auto const& deviatoric_matrix = Invariants::deviatoric_projection;
65 double const norm_s_try =
66 Invariants::FrobeniusNorm(deviatoric_matrix * sigma_try);
68 if (norm_s_try < std::numeric_limits<double>::epsilon() * C(0, 0))
70 return {std::make_tuple(sigma_try, createMaterialStateVariables(), C)};
75 const double A = _a(t, x)[0];
76 const double n = _n(t, x)[0];
77 const double sigma0 = _sigma_f(t, x)[0];
78 const double Q = _q(t, x)[0];
80 const double constant_coefficient =
84 dt * constant_coefficient *
87 double const G2b = 2.0 * b * this->_mp.mu(t, x);
89 auto const update_jacobian = [&solution, &G2b, &n](
JacobianMatrix& jacobian)
91 auto const& D = Invariants::deviatoric_projection;
93 double const norm_s_n1 = Invariants::FrobeniusNorm(s_n1);
94 double const pow_norm_s_n1_n_minus_one_2b_G =
95 G2b * std::pow(norm_s_n1, n - 1);
96 jacobian = KelvinMatrix::Identity() +
97 (pow_norm_s_n1_n_minus_one_2b_G * D +
98 (n - 1) * G2b * std::pow(norm_s_n1, n - 3) * s_n1 *
102 auto const update_residual =
105 KelvinVector const s_n1 = Invariants::deviatoric_projection * solution;
106 double const norm_s_n1 = Invariants::FrobeniusNorm(s_n1);
107 double const pow_norm_s_n1_n_minus_one_2b_G =
108 G2b * std::pow(norm_s_n1, n - 1);
109 r = solution - sigma_try + pow_norm_s_n1_n_minus_one_2b_G * s_n1;
113 { solution += increment; };
117 update_solution, _nonlinear_solver_parameters);
120 auto const success_iterations = newton_solver.solve(jacobian);
122 if (!success_iterations)
131 (*success_iterations == 0) ? C : linear_solver.solve(C);
133 return {std::make_tuple(solution, createMaterialStateVariables(),
std::optional< std::tuple< KelvinVector, std::unique_ptr< typename MechanicsBase< DisplacementDim >::MaterialStateVariables >, KelvinMatrix > > integrateStress(MaterialPropertyLib::VariableArray const &variable_array_prev, MaterialPropertyLib::VariableArray const &variable_array, double const t, ParameterLib::SpatialPosition const &x, double const dt, typename MechanicsBase< DisplacementDim >::MaterialStateVariables const &material_state_variables) const override