162 const std::vector<Real> & intnl,
163 std::vector<yieldAndFlow> & all_q)
const
169 const Real sinphi = std::sin(
_phi.
value(intnl[0]));
171 const Real sinpsi = std::sin(
_psi.
value(intnl[0]));
177 const Real smax = stress_params[2];
178 const Real smid = stress_params[1];
179 const Real smin = stress_params[0];
182 all_q[0].f = smax - ts;
183 all_q[1].f = smid - ts;
184 all_q[2].f = smin - ts;
185 all_q[3].f = -smin - cs;
186 all_q[4].f = -smid - cs;
187 all_q[5].f = -smax - cs;
188 all_q[6].f = 0.5 * (smax - smin) + 0.5 * (smax + smin) * sinphi - cohcos;
189 all_q[7].f = 0.5 * (smid - smin) + 0.5 * (smid + smin) * sinphi - cohcos;
190 all_q[8].f = 0.5 * (smax - smid) + 0.5 * (smax + smid) * sinphi - cohcos;
191 all_q[9].f = 0.5 * (smid - smax) + 0.5 * (smid + smax) * sinphi - cohcos;
192 all_q[10].f = 0.5 * (smin - smid) + 0.5 * (smin + smid) * sinphi - cohcos;
193 all_q[11].f = 0.5 * (smin - smax) + 0.5 * (smin + smax) * sinphi - cohcos;
196 for (
unsigned yf = 0; yf <
_num_yf; ++yf)
198 all_q[yf].df[
a] = 0.0;
199 all_q[0].df[2] = 1.0;
200 all_q[1].df[1] = 1.0;
201 all_q[2].df[0] = 1.0;
202 all_q[3].df[0] = -1.0;
203 all_q[4].df[1] = -1.0;
204 all_q[5].df[2] = -1.0;
205 all_q[6].df[2] = 0.5 * (1.0 + sinphi);
206 all_q[6].df[0] = 0.5 * (-1.0 + sinphi);
207 all_q[7].df[1] = 0.5 * (1.0 + sinphi);
208 all_q[7].df[0] = 0.5 * (-1.0 + sinphi);
209 all_q[8].df[2] = 0.5 * (1.0 + sinphi);
210 all_q[8].df[1] = 0.5 * (-1.0 + sinphi);
211 all_q[9].df[1] = 0.5 * (1.0 + sinphi);
212 all_q[9].df[2] = 0.5 * (-1.0 + sinphi);
213 all_q[10].df[0] = 0.5 * (1.0 + sinphi);
214 all_q[10].df[1] = 0.5 * (-1.0 + sinphi);
215 all_q[11].df[0] = 0.5 * (1.0 + sinphi);
216 all_q[11].df[2] = 0.5 * (-1.0 + sinphi);
219 for (
unsigned i = 0; i < 6; ++i)
220 all_q[i].df_di[0] = 0.0;
221 all_q[0].df_di[1] = all_q[1].df_di[1] = all_q[2].df_di[1] = -dts;
222 all_q[3].df_di[1] = all_q[4].df_di[1] = all_q[5].df_di[1] = -dcs;
223 for (
unsigned i = 6; i < 12; ++i)
224 all_q[i].df_di[1] = 0.0;
225 all_q[6].df_di[0] = 0.5 * (smax + smin) * dsinphi - dcohcos;
226 all_q[7].df_di[0] = 0.5 * (smid + smin) * dsinphi - dcohcos;
227 all_q[8].df_di[0] = 0.5 * (smax + smid) * dsinphi - dcohcos;
228 all_q[9].df_di[0] = 0.5 * (smid + smax) * dsinphi - dcohcos;
229 all_q[10].df_di[0] = 0.5 * (smin + smid) * dsinphi - dcohcos;
230 all_q[11].df_di[0] = 0.5 * (smin + smax) * dsinphi - dcohcos;
234 for (
unsigned yf = 0; yf < 6; ++yf)
236 all_q[yf].dg[
a] = all_q[yf].df[
a];
237 all_q[6].dg[2] = all_q[7].dg[1] = all_q[8].dg[2] = all_q[9].dg[1] = all_q[10].dg[0] =
238 all_q[11].dg[0] = 0.5 * (1.0 + sinpsi);
239 all_q[6].dg[0] = all_q[7].dg[0] = all_q[8].dg[1] = all_q[9].dg[2] = all_q[10].dg[1] =
240 all_q[11].dg[2] = 0.5 * (-1.0 + sinpsi);
243 for (
unsigned yf = 0; yf <
_num_yf; ++yf)
246 all_q[yf].d2g_di[
a][i] = 0.0;
247 all_q[6].d2g_di[2][0] = all_q[7].d2g_di[1][0] = all_q[8].d2g_di[2][0] = all_q[9].d2g_di[1][0] =
248 all_q[10].d2g_di[0][0] = all_q[11].d2g_di[0][0] = 0.5 * dsinpsi;
249 all_q[6].d2g_di[0][0] = all_q[7].d2g_di[0][0] = all_q[8].d2g_di[1][0] = all_q[9].d2g_di[2][0] =
250 all_q[10].d2g_di[1][0] = all_q[11].d2g_di[2][0] = 0.5 * dsinpsi;
253 for (
unsigned yf = 0; yf <
_num_yf; ++yf)
256 all_q[yf].d2g[
a][
b] = 0.0;
279 const std::vector<Real> & intnl_old,
280 std::vector<Real> & stress_params,
282 std::vector<Real> & intnl)
const
286 for (
unsigned i = 0; i <
_num_sp; ++i)
287 stress_params[i] = trial_stress_params[i];
294 const Real sinphi = std::sin(
_phi.
value(intnl_old[0]));
297 const Real trial_tensile_yf = trial_stress_params[2] - ts;
298 const Real trial_compressive_yf = -trial_stress_params[0] - cs;
299 const Real trial_mc_yf = 0.5 * (trial_stress_params[2] - trial_stress_params[0]) +
300 0.5 * (trial_stress_params[2] + trial_stress_params[0]) * sinphi -
328 bool found_solution =
false;
330 if (trial_tensile_yf <=
_f_tol && trial_compressive_yf <=
_f_tol && trial_mc_yf <=
_f_tol)
334 for (
unsigned i = 0; i <
_num_sp; ++i)
335 stress_params[i] = trial_stress_params[i];
337 found_solution =
true;
340 const bool tensile_possible = (ts < cohcos / sinphi);
341 const bool mc_tip_possible = (cohcos / sinphi < ts);
342 const bool mc_impossible = (0.5 * (ts + cs) + 0.5 * (ts - cs) * sinphi - cohcos <
345 const Real sinpsi = std::sin(
_psi.
value(intnl_old[0]));
346 const Real halfplus = 0.5 + 0.5 * sinpsi;
347 const Real neghalfplus = -0.5 + 0.5 * sinpsi;
349 if (!found_solution && tensile_possible && trial_tensile_yf >
_f_tol &&
350 (trial_compressive_yf <=
_f_tol || (trial_compressive_yf >
_f_tol && mc_impossible)))
356 const Real ga = (trial_stress_params[2] - ts) /
_Eij[2][2];
357 stress_params[2] = ts;
358 stress_params[1] = trial_stress_params[1] - ga *
_Eij[1][2];
359 stress_params[0] = trial_stress_params[0] - ga *
_Eij[0][2];
363 const Real to_subtract1 = stress_params[1] - (ts - 0.5 *
_shifter);
364 if (to_subtract1 > 0.0)
366 dist_mod += Utility::pow<2>(to_subtract1 / (trial_stress_params[2] - ts));
367 stress_params[1] -= to_subtract1;
369 const Real to_subtract0 = stress_params[0] - (ts -
_shifter);
370 if (to_subtract0 > 0.0)
372 dist_mod += Utility::pow<2>(to_subtract0 / (trial_stress_params[2] - ts));
373 stress_params[0] -= to_subtract0;
377 const Real to_add0 = -stress_params[0] - cs;
380 dist_mod += Utility::pow<2>(to_add0 / (trial_stress_params[2] - ts));
381 stress_params[0] += to_add0;
383 const Real to_add1 = -cs + 0.5 *
_shifter - stress_params[1];
386 dist_mod += Utility::pow<2>(to_add1 / (trial_stress_params[2] - ts));
387 stress_params[1] += to_add1;
391 const Real new_compressive_yf = -stress_params[0] - cs;
392 const Real new_mc_yf = 0.5 * (stress_params[2] - stress_params[0]) +
393 0.5 * (stress_params[2] + stress_params[0]) * sinphi - cohcos;
394 if (new_mc_yf <=
_f_tol && new_compressive_yf <=
_f_tol)
396 gaE = std::sqrt(dist_mod) * (trial_stress_params[2] - stress_params[2]);
397 found_solution =
true;
400 if (!found_solution && trial_compressive_yf >
_f_tol &&
401 (trial_tensile_yf <=
_f_tol || (trial_tensile_yf >
_f_tol && mc_impossible)))
406 const Real ga = (trial_stress_params[0] + cs) /
_Eij[0][0];
407 stress_params[0] = -cs;
408 stress_params[1] = trial_stress_params[1] - ga *
_Eij[1][0];
409 stress_params[2] = trial_stress_params[2] - ga *
_Eij[2][0];
413 const Real to_add1 = -cs + 0.5 *
_shifter - stress_params[1];
416 dist_mod += Utility::pow<2>(to_add1 / (trial_stress_params[0] + cs));
417 stress_params[1] += to_add1;
419 const Real to_add2 = -cs +
_shifter - stress_params[2];
422 dist_mod += Utility::pow<2>(to_add2 / (trial_stress_params[0] + cs));
423 stress_params[2] += to_add2;
427 const Real to_subtract2 = stress_params[2] - ts;
428 if (to_subtract2 > 0.0)
430 dist_mod += Utility::pow<2>(to_subtract2 / (trial_stress_params[0] + cs));
431 stress_params[2] -= to_subtract2;
433 const Real to_subtract1 = stress_params[1] - (ts - 0.5 *
_shifter);
434 if (to_subtract1 > 0.0)
436 dist_mod += Utility::pow<2>(to_subtract1 / (trial_stress_params[0] + cs));
437 stress_params[1] -= to_subtract1;
441 const Real new_tensile_yf = stress_params[2] - ts;
442 const Real new_mc_yf = 0.5 * (stress_params[2] - stress_params[0]) +
443 0.5 * (stress_params[2] + stress_params[0]) * sinphi - cohcos;
446 gaE = std::sqrt(dist_mod) * (-trial_stress_params[0] + stress_params[0]);
447 found_solution =
true;
450 if (!found_solution && !mc_impossible && trial_mc_yf >
_f_tol)
454 const Real ga = ((trial_stress_params[2] - trial_stress_params[0]) +
455 (trial_stress_params[2] + trial_stress_params[0]) * sinphi - 2.0 * cohcos) /
458 trial_stress_params[2] - ga * (
_Eij[2][2] * halfplus +
_Eij[2][0] * neghalfplus);
459 stress_params[1] = trial_stress_params[1] - ga *
_Eij[1][0] * sinpsi;
461 trial_stress_params[0] - ga * (
_Eij[0][0] * neghalfplus +
_Eij[0][2] * halfplus);
462 const Real f7 = 0.5 * (stress_params[1] - stress_params[0]) +
463 0.5 * (stress_params[1] + stress_params[0]) * sinphi - cohcos;
464 const Real f8 = 0.5 * (stress_params[2] - stress_params[1]) +
465 0.5 * (stress_params[2] + stress_params[1]) * sinphi - cohcos;
466 const Real new_tensile_yf = stress_params[2] - ts;
467 const Real new_compressive_yf = -stress_params[0] - cs;
471 gaE = ((trial_stress_params[2] - trial_stress_params[0]) -
472 (stress_params[2] - stress_params[0])) /
474 found_solution =
true;
477 if (!found_solution && !mc_impossible && trial_mc_yf >
_f_tol)
492 const Real cmax6 =
_Eij[2][2] * halfplus +
_Eij[2][0] * neghalfplus;
493 const Real cmax7 =
_Eij[2][1] * halfplus +
_Eij[2][0] * neghalfplus;
496 const Real cmin6 =
_Eij[0][2] * halfplus +
_Eij[0][0] * neghalfplus;
497 const Real cmin7 =
_Eij[0][1] * halfplus +
_Eij[0][0] * neghalfplus;
501 const Real c6 = 0.5 * (cmax6 - cmin6) + 0.5 * (cmax6 + cmin6) * sinphi;
502 const Real c7 = 0.5 * (cmax7 - cmin7) + 0.5 * (cmax7 + cmin7) * sinphi;
508 const Real f6_trial = trial_mc_yf;
509 const Real f7_trial = 0.5 * (trial_stress_params[1] - trial_stress_params[0]) +
510 0.5 * (trial_stress_params[1] + trial_stress_params[0]) * sinphi -
512 const Real descr = Utility::pow<2>(c6) - Utility::pow<2>(c7);
513 Real ga6 = (c6 * f6_trial - c7 * f7_trial) / descr;
514 Real ga7 = (-c7 * f6_trial + c6 * f7_trial) / descr;
516 stress_params[2] = trial_stress_params[2] - ga6 * cmax6 - ga7 * cmax7;
517 stress_params[0] = trial_stress_params[0] - ga6 * cmin6 - ga7 * cmin7;
518 stress_params[1] = stress_params[2] - 0.5 *
_shifter;
520 Real f8 = 0.5 * (stress_params[2] - stress_params[1]) +
521 0.5 * (stress_params[2] + stress_params[1]) * sinphi - cohcos;
523 if (mc_tip_possible && f8 >
_f_tol)
525 stress_params[2] = cohcos / sinphi;
526 stress_params[1] = stress_params[2] - 0.5 *
_shifter;
527 stress_params[0] = stress_params[2] -
_shifter;
533 const Real new_tensile_yf = stress_params[2] - ts;
534 const Real new_compressive_yf = -stress_params[0] - cs;
537 ga6 >= 0.0 && ga7 >= 0.0)
539 gaE = ((trial_stress_params[2] - trial_stress_params[0]) -
540 (stress_params[2] - stress_params[0])) /
542 found_solution =
true;
546 if (!found_solution && !mc_impossible && trial_mc_yf >
_f_tol)
561 const Real cmax6 =
_Eij[2][2] * halfplus +
_Eij[2][0] * neghalfplus;
562 const Real cmax8 =
_Eij[2][2] * halfplus +
_Eij[2][1] * neghalfplus;
565 const Real cmin6 =
_Eij[0][2] * halfplus +
_Eij[0][0] * neghalfplus;
566 const Real cmin8 =
_Eij[0][2] * halfplus +
_Eij[0][1] * neghalfplus;
570 const Real c6 = 0.5 * (cmax6 - cmin6) + 0.5 * (cmax6 + cmin6) * sinphi;
571 const Real c8 = 0.5 * (cmax8 - cmin8) + 0.5 * (cmax8 + cmin8) * sinphi;
577 const Real f6_trial = trial_mc_yf;
578 const Real f8_trial = 0.5 * (trial_stress_params[2] - trial_stress_params[1]) +
579 0.5 * (trial_stress_params[2] + trial_stress_params[1]) * sinphi -
581 const Real descr = Utility::pow<2>(c6) - Utility::pow<2>(c8);
582 Real ga6 = (c6 * f6_trial - c8 * f8_trial) / descr;
583 Real ga8 = (-c8 * f6_trial + c6 * f8_trial) / descr;
585 stress_params[2] = trial_stress_params[2] - ga6 * cmax6 - ga8 * cmax8;
586 stress_params[0] = trial_stress_params[0] - ga6 * cmin6 - ga8 * cmin8;
587 stress_params[1] = stress_params[0] + 0.5 *
_shifter;
589 Real f7 = 0.5 * (stress_params[1] - stress_params[0]) +
590 0.5 * (stress_params[1] + stress_params[0]) * sinphi - cohcos;
592 if (mc_tip_possible && f7 >
_f_tol)
594 stress_params[2] = cohcos / sinphi;
595 stress_params[1] = stress_params[2] - 0.5 *
_shifter;
596 stress_params[0] = stress_params[2] -
_shifter;
602 const Real new_tensile_yf = stress_params[2] - ts;
603 const Real new_compressive_yf = -stress_params[0] - cs;
606 ga6 >= 0.0 && ga8 >= 0.0)
608 gaE = ((trial_stress_params[2] - trial_stress_params[0]) -
609 (stress_params[2] - stress_params[0])) /
611 found_solution =
true;
615 if (!found_solution && !mc_impossible && tensile_possible && trial_tensile_yf >
_f_tol)
630 const Real cmax6 =
_Eij[2][2] * halfplus +
_Eij[2][0] * neghalfplus;
631 const Real cmax0 =
_Eij[2][2];
632 const Real cmid6 =
_Eij[1][2] * halfplus +
_Eij[1][0] * neghalfplus;
633 const Real cmid0 =
_Eij[1][2];
634 const Real cmin6 =
_Eij[0][2] * halfplus +
_Eij[0][0] * neghalfplus;
635 const Real cmin0 =
_Eij[0][2];
639 const Real c6 = 0.5 * (cmax6 - cmin6) + 0.5 * (cmax6 + cmin6) * sinphi;
640 const Real c0 = 0.5 * (cmax0 - cmin0) + 0.5 * (cmax0 + cmin0) * sinphi;
644 const Real descr = c0 * cmax6 - c6 * cmax0;
647 const Real ga0 = (-c6 * trial_tensile_yf + cmax6 * trial_mc_yf) / descr;
648 const Real ga6 = (c0 * trial_tensile_yf - cmax0 * trial_mc_yf) / descr;
649 stress_params[2] = trial_stress_params[2] - ga6 * cmax6 - ga0 * cmax0;
650 stress_params[1] = trial_stress_params[1] - ga6 * cmid6 - ga0 * cmid0;
651 stress_params[0] = trial_stress_params[0] - ga6 * cmin6 - ga0 * cmin0;
655 std::min(stress_params[0],
660 const bool goto_corner = (stress_params[1] >= stress_params[2] - 0.5 *
_shifter);
661 stress_params[1] = std::max(std::min(stress_params[1], stress_params[2] - 0.5 *
_shifter),
664 const Real new_compressive_yf = -stress_params[0] - cs;
665 if (new_compressive_yf <=
_f_tol &&
666 (goto_corner || (ga0 >= 0.0 && ga6 >= 0.0)))
668 gaE = ((trial_stress_params[2] - trial_stress_params[0]) -
669 (stress_params[2] - stress_params[0])) /
671 (trial_stress_params[2] - stress_params[2]);
672 found_solution =
true;
676 if (!found_solution && !mc_impossible)
691 const Real cmax6 =
_Eij[2][2] * halfplus +
_Eij[2][0] * neghalfplus;
692 const Real cmax3 = -
_Eij[2][0];
693 const Real cmid6 =
_Eij[1][2] * halfplus +
_Eij[1][0] * neghalfplus;
694 const Real cmid3 = -
_Eij[1][0];
695 const Real cmin6 =
_Eij[0][2] * halfplus +
_Eij[0][0] * neghalfplus;
696 const Real cmin3 = -
_Eij[0][0];
700 const Real c6 = 0.5 * (cmax6 - cmin6) + 0.5 * (cmax6 + cmin6) * sinphi;
701 const Real c3 = 0.5 * (cmax3 - cmin3) + 0.5 * (cmax3 + cmin3) * sinphi;
705 const Real descr = c3 * cmin6 - c6 * cmin3;
708 const Real ga3 = (c6 * trial_compressive_yf + cmin6 * trial_mc_yf) / descr;
709 const Real ga6 = (-c3 * trial_compressive_yf - cmin3 * trial_mc_yf) / descr;
710 stress_params[2] = trial_stress_params[2] - ga6 * cmax6 - ga3 * cmax3;
711 stress_params[1] = trial_stress_params[1] - ga6 * cmid6 - ga3 * cmid3;
712 stress_params[0] = trial_stress_params[0] - ga6 * cmin6 - ga3 * cmin3;
714 const Real new_tensile_yf = stress_params[2] - ts;
716 std::max(stress_params[2],
718 stress_params[1] = std::max(std::min(stress_params[1], stress_params[2] - 0.5 *
_shifter),
721 if (new_tensile_yf <= _f_tol && ga6 >= 0.0)
723 gaE = ((trial_stress_params[2] - trial_stress_params[0]) -
724 (stress_params[2] - stress_params[0])) /
726 (-trial_stress_params[0] - stress_params[0]);
728 found_solution =
true;
735 for (
unsigned i = 0; i <
_num_sp; ++i)
736 stress_params[i] = trial_stress_params[i];
738 mooseWarning(
"CappedMohrCoulombStressUpdate cannot initialize from max = ",