17 static LoggerPtr logger(Logger::getLogger(
"plasticity.poroelastoplastic"));
21 static LoggerPtr loggerConvTest(Logger::getLogger(
"ConvTest"));
24 TPZSandlerExtended::TPZSandlerExtended() : ftol(1e-8), fA(0), fB(0), fC(0), fD(0), fW(0), fK(0), fR(0), fG(0), fPhi(0), fN(0), fPsi(0), fE(0), fnu(0), fkappa_0(0) {
46 TPZSandlerExtended::TPZSandlerExtended(STATE
A, STATE
B, STATE
C, STATE
D, STATE
K, STATE
G, STATE
W, STATE
R, STATE
Phi, STATE
N, STATE Psi, STATE kappa_0) :
47 fA(A),
fB(B),
fC(C),
fD(D),
fW(W),
fK(K),
fR(R),
fG(G),
fPhi(Phi),
fN(N),
fPsi(Psi),
fkappa_0(kappa_0) {
76 return (L -
fR *
F(L));
83 void TPZSandlerExtended::SetUp(STATE
A, STATE
B, STATE
C, STATE
D, STATE
K, STATE
G, STATE
W, STATE
R, STATE
Phi, STATE
N, STATE Psi) {
168 return (
fW * (
exp(
fD * X) - 1 + CPer * X));
177 STATE
f, df, kn1, kn, resnorm, diff;
182 while (resnorm >
ftol && counter < 30) {
189 resnorm =
sqrt(diff * diff);
215 bool Is_valid_stress_Q =
fabs(f[0]) <
ftol || f[0] < 0.0;
217 if (Is_valid_stress_Q) {
220 REAL I1 = (stress_pv[0])+(stress_pv[1])+(stress_pv[2]);
221 REAL
res, jac, dk, k;
224 bool stop_criterion_Q =
false;
226 for (i = 0; i < n_iter; i++) {
228 stop_criterion_Q =
fabs(res) <
ftol;
229 if (stop_criterion_Q) {
237 if (!stop_criterion_Q) {
238 throw TPZConvergenceException(
ftol, n_iter, res, i,
"TPZSandlerExtended::InitialDamage:: Newton process did not converge in hydrostatic direction.");
241 stop_criterion_Q =
false;
242 REAL J2 = (1.0/3.0) * (stress_pv[0]*stress_pv[0] + stress_pv[1]*stress_pv[1] + stress_pv[2]*stress_pv[2] - stress_pv[1]*stress_pv[2] - stress_pv[0]*stress_pv[2] - stress_pv[0]*stress_pv[1]);
244 bool pure_hydrostatic_state_Q =
IsZero(J2) || J2 < 0.0;
245 if (!pure_hydrostatic_state_Q) {
248 for (
int i = 0; i < n_iter; i++) {
255 stop_criterion_Q =
fabs(res) <
ftol;
256 if (stop_criterion_Q) {
259 jac = (2*(
fA*(-I1 + k) +
exp(
fB*k)*fC*
266 if (!stop_criterion_Q) {
267 throw TPZConvergenceException(
ftol, n_iter, res, i,
"TPZSandlerExtended::InitialDamage:: Newton process did not converge in deviatoric direction.");
273 bool Is_valid_stress_on_cap_Q =
fabs(f[1]) <
ftol || f[1] < 0.0;
275 if (!Is_valid_stress_on_cap_Q) {
291 T trial_I1 = (trial_stress[0])+(trial_stress[1])+(trial_stress[2]);
292 T I1 =
fR *
F(k) *
cos(theta) + k;
294 return (3. *
fK * delepsp - (trial_I1 - I1));
300 T I1tr = sigtrialIJ[0];
301 T I1 =
fR *
F(k) *
cos(theta) + k;
303 return (3. *
fK * delepsp - (I1tr - I1));
309 STATE I1trial = (sigtrial[0] + sigtrial[1] + sigtrial[2]);
310 STATE I1proj = (sigproj[0] + sigproj[1] + sigproj[2]);
312 return (3. *
fK * delepsp - (I1trial - I1proj));
320 STATE expfBk =
exp(
fB * k);
321 STATE dreskk = 3. *
exp(
fD * (-((
fA - expfBk *
fC) *
fR) + k)) *
fD *
fK *
322 (1. + expfBk *
fB * fC *
fR) *
fW;
330 STATE expfBk =
exp(
fB * k);
331 STATE sintheta =
sin(theta);
332 STATE costheta =
cos(theta);
334 STATE dreskk = 1. + costheta * (-(expfBk *
fB *
fC) -
fPhi) *
fR +
336 (1. + expfBk *
fB * fC *
fR) *
fW;
339 STATE dresktheta = -fR * (
fA - fC * expfBk - k *
fPhi) * sintheta;
340 dresl[0] = dresktheta;
348 STATE sqrt2 = M_SQRT2;
349 STATE sqrt3 =
sqrt(3.);
353 STATE sqrtj2 = F1 /
gamma;
354 STATE rho = sqrt2*sqrtj2;
375 const STATE M_SQRT3 =
sqrt(3.);
376 const STATE
gamma = 0.5 * (1.0 +
sin(3.0 * beta) + (1.0 -
sin(3.0 * beta)) /
fPsi);
377 const STATE Fk =
F(k);
378 const STATE var =
fR * Fk *
cos(theta);
379 const STATE sig1_star = (k - var) / M_SQRT3;
380 const STATE sqrtj2 = Fk *
sin(theta) /
gamma;
381 const STATE rho = M_SQRT2*sqrtj2;
382 const STATE xi = sig1_star;
395 STATE I1 = sigHWCyl[0] *
sqrt(3.);
399 STATE costheta = (I1 - k) / (
fR * Fk);
400 STATE sqrtj2 = sigHWCyl[1] /
sqrt(2.);
401 STATE sintheta = sqrtj2 * gamma / (Fk -
fN);
402 theta =
atan2(sintheta, costheta);
406 STATE err = 1. - sintheta * sintheta - costheta*costheta;
416 F1Cyl(xi, beta, cyl);
421 return ((1. / (3. *
fK))*(carttrial[0] - cart[0])*(carttrial[0] - cart[0]))
422 +(1. / (2. *
fG))*((carttrial[1] - cart[1])*(carttrial[1] - cart[1])+(carttrial[2] - cart[2])*(carttrial[2] - cart[2]));
429 F2Cyl(theta, beta, k, cart_trial);
432 return ((1. / (3. *
fK))*(cart_trial[0] - cart[0])*(cart_trial[0] - cart[0]))
433 +(1. / (2. *
fG))*((cart_trial[1] - cart[1])*(cart_trial[1] - cart[1])+(cart_trial[2] - cart[2])*(cart_trial[2] - cart[2]));
438 STATE I1 = sigtrialIJ[0];
439 STATE sqJ2 = sigtrialIJ[1];
442 STATE y = (sqJ2 - Fk *
sin(theta));
443 STATE x = 1. / (3 *
fK)*(I1 - (k + Fk *
fR *
cos(theta)));
444 STATE
res = x * x / (9. *
fK) + y * y / (
fG);
452 sigIJ[0] = K + Fk *
fR *
cos(theta);
453 sigIJ[1] = Fk *
sin(theta);
461 T I1 = sigtrialIJ[0];
462 T sqJ2 = sigtrialIJ[1];
465 T y = (sqJ2 - Fk *
sin(theta));
466 T x = (I1 - (L + Fk *
fR *
cos(theta)));
467 ddistf2[0] = T(2.) * x * Fk *
fR *
sin(theta) / T(9. *
fK) - T(2.) * y * Fk *
cos(theta);
468 ddistf2[1] =
ResLF2IJ(sigtrialIJ, theta, L, LPrev);
470 if (logger->isDebugEnabled()) {
471 std::stringstream sout;
472 sout <<
"x = " << x <<
" y = " << y <<
" theta = " << theta <<
" res = " << ddistf2[0];
479 STATE sigstar1, sigstar2, sigstar3, DFf, Ff, I1, sb, cb, DGamma;
483 STATE sin3b =
sin(3 * beta);
484 STATE cos3b =
cos(3 * beta);
486 sigstar1 = ptcart[0];
487 sigstar2 = ptcart[1];
488 sigstar3 = ptcart[2];
491 const REAL
gamma = (1 + sin3b + (1 - sin3b) /
fPsi) / 2.;
492 const REAL gamma2 = gamma*
gamma;
493 const REAL gamma3 = gamma*gamma2;
495 DGamma = 0.5*(3 * cos3b - (3 * cos3b) /
fPsi);
496 const REAL sqrt2 = M_SQRT2;
497 const REAL sqrt3 =
sqrt(3.);
500 ddistf1(0, 0) = (6 * sqrt3 * DFf * Ff *
fK - 3 * sqrt3 * sqrt2 * DFf *
fK * gamma * (cb * sigstar2 + sb * sigstar3) + 2 *
fG * gamma2 * (-sigstar1 + xi)) / (3. *
fG *
fK * gamma2);
501 ddistf1(1, 0) = -((Ff * sqrt2 * (gamma2 * (-(sb * sigstar2) + cb * sigstar3) - DGamma * gamma * (cb * sigstar2 + sb * sigstar3) + DGamma * Ff * sqrt2)) / (
fG * gamma3));
506 STATE sig2, sig3, DFf, Gamma, Ff, I1, sb, cb, D2Ff, DGamma, D2Gamma, Gamma2, Gamma3, Sqrt2, Sqrt3;
510 STATE sin3b =
sin(3 * beta);
511 STATE cos3b =
cos(3 * beta);
518 Gamma = (1. + sin3b + (1. - sin3b) /
fPsi) / 2.;
521 DGamma = (3. * cos3b - (3. * cos3b) /
fPsi) / 2.;
522 D2Gamma = (-9. *
sin(3. * beta) + (9. *
sin(3. * beta)) /
fPsi) / 2.;
523 Gamma2 = Gamma*Gamma;
524 Gamma3 = Gamma*Gamma2;
532 tangentf1(0, 0) = (18 * (DFf * DFf + D2Ff * Ff) *
fK + 2 *
fG * Gamma2 -
533 9 * D2Ff *
fK * Gamma * (cb * sig2 + sb * sig3) * Sqrt2) / (3. *
fG *
fK * Gamma2);
535 tangentf1(0, 1) = -((Sqrt3 * Sqrt2 * DFf * (Gamma2 * (-(sb * sig2) + cb * sig3) - DGamma * Gamma * (cb * sig2 + sb * sig3) +
536 2 * DGamma * Ff * Sqrt2)) / (
fG * Gamma3));
538 tangentf1(1, 1) = -((Ff * (-6 * DGamma * DGamma * Ff - Gamma3 * (cb * sig2 + sb * sig3) * Sqrt2 -
539 Gamma2 * (2 * DGamma * (-(sb * sig2) + cb * sig3) + D2Gamma * (cb * sig2 + sb * sig3)) *
540 Sqrt2 + 2 * Gamma * (D2Gamma * Ff + DGamma * DGamma * (cb * sig2 + sb * sig3) * Sqrt2))) /
541 (
fG * Gamma2 * Gamma2));
543 tangentf1(1, 0) = tangentf1(0, 1);
557 STATE CK =
fE/(3.0*(1.0 - 2.0 *
fnu));
558 STATE
CG =
fE/(2.0*(1.0 +
fnu));
573 rhw_sigma[2]*(1 +
fPsi + (-1 +
fPsi)*
sin(3*beta))) +
575 rhw_sigma[1]*(1 +
fPsi + (-1 +
fPsi)*
sin(3*beta)))*
581 CPer*
exp(
fB*kprev)*
fC*
fR + CPer*(-k + kprev)) +
sqrt(3)*rhw_sigma[0];
593 STATE CK =
fE/(3.0*(1.0 - 2.0 *
fnu));
594 STATE
CG =
fE/(2.0*(1.0 +
fnu));
604 ((1.0 +
fPsi)*rhw_sigma[1] + (-1.0 +
fPsi)*rhw_sigma[1]*
sin(3.0*beta) -
607 ((1 +
fPsi)*rhw_sigma[2] + (-1.0 +
fPsi)*rhw_sigma[2]*
sin(3.0*beta) -
613 (rhw_sigma[1]*(1.0 +
fPsi + (-1.0 +
fPsi)*
sin(3.0*beta)) -
616 (rhw_sigma[2]*(1.0 +
fPsi + (-1.0 +
fPsi)*
sin(3.0*beta)) -
623 CPer*
exp(
fB*kprev)*fC*
fR - CPer*k + CPer*kprev) +
sqrt(3.0)*rhw_sigma[0] +
633 residue_covertex.
Resize(2, 1);
636 STATE CK =
fE/(3.0*(1.0 - 2.0 *
fnu));
637 STATE
CG =
fE/(2.0*(1.0 +
fnu));
638 STATE theta = M_PI_2;
646 rhw_sigma[1]*(1 +
fPsi + (-1 +
fPsi)*
sin(3*beta)))*
653 CPer*
exp(
fB*kprev)*
fC*
fR + CPer*(-k + kprev)) +
sqrt(3)*rhw_sigma[0];
662 STATE CK =
fE/(3.0*(1.0 - 2.0 *
fnu));
679 STATE CK =
fE/(3.0*(1.0 - 2.0 *
fnu));
680 STATE
CG =
fE/(2.0*(1.0 +
fnu));
699 pow(
fPsi,2)*rhw_sigma[1]*
cos(4*beta) + 2*rhw_sigma[2]*
cos(5*beta) - 4*
fPsi*rhw_sigma[2]*
cos(5*beta) +
700 2*
pow(
fPsi,2)*rhw_sigma[2]*
cos(5*beta) - rhw_sigma[2]*
cos(7*beta) + 2*
fPsi*rhw_sigma[2]*
cos(7*beta) -
701 pow(
fPsi,2)*rhw_sigma[2]*
cos(7*beta) + 3*rhw_sigma[1]*
sin(beta) + 2*
fPsi*rhw_sigma[1]*
sin(beta) +
703 rhw_sigma[2]*
sin(4*beta) +
pow(
fPsi,2)*rhw_sigma[2]*
sin(4*beta) + 2*rhw_sigma[1]*
sin(5*beta) -
704 4*
fPsi*rhw_sigma[1]*
sin(5*beta) + 2*
pow(
fPsi,2)*rhw_sigma[1]*
sin(5*beta) + rhw_sigma[1]*
sin(7*beta) -
715 pow(
fPsi,2)*rhw_sigma[1]*
cos(4*beta) + 2*rhw_sigma[2]*
cos(5*beta) - 4*
fPsi*rhw_sigma[2]*
cos(5*beta) +
716 2*
pow(
fPsi,2)*rhw_sigma[2]*
cos(5*beta) - rhw_sigma[2]*
cos(7*beta) + 2*
fPsi*rhw_sigma[2]*
cos(7*beta) -
717 pow(
fPsi,2)*rhw_sigma[2]*
cos(7*beta) + 3*rhw_sigma[1]*
sin(beta) + 2*
fPsi*rhw_sigma[1]*
sin(beta) +
719 rhw_sigma[2]*
sin(4*beta) +
pow(
fPsi,2)*rhw_sigma[2]*
sin(4*beta) + 2*rhw_sigma[1]*
sin(5*beta) -
720 4*
fPsi*rhw_sigma[1]*
sin(5*beta) + 2*
pow(
fPsi,2)*rhw_sigma[1]*
sin(5*beta) + rhw_sigma[1]*
sin(7*beta) -
730 rhw_sigma[1]*(1 +
fPsi + (-1 +
fPsi)*
sin(3*beta))) +
734 rhw_sigma[2]*(1 +
fPsi + (-1 +
fPsi)*
sin(3*beta)))*
743 jacobianf1(2,0) = -1;
764 STATE CK =
fE/(3.0*(1.0 - 2.0 *
fnu));
765 STATE
CG =
fE/(2.0*(1.0 +
fnu));
778 (rhw_sigma[1]*(1 +
fPsi + (-1 +
fPsi)*
sin(3*beta)) -
781 (rhw_sigma[2]*(1 +
fPsi + (-1 +
fPsi)*
sin(3*beta)) -
789 rhw_sigma[1]*
cos(4*beta) +
pow(
fPsi,2)*rhw_sigma[1]*
cos(4*beta) + 2*rhw_sigma[2]*
cos(5*beta) -
790 4*
fPsi*rhw_sigma[2]*
cos(5*beta) + 2*
pow(
fPsi,2)*rhw_sigma[2]*
cos(5*beta) - rhw_sigma[2]*
cos(7*beta) +
791 2*
fPsi*rhw_sigma[2]*
cos(7*beta) -
pow(
fPsi,2)*rhw_sigma[2]*
cos(7*beta) + 3*rhw_sigma[1]*
sin(beta) +
792 2*
fPsi*rhw_sigma[1]*
sin(beta) + 3*
pow(
fPsi,2)*rhw_sigma[1]*
sin(beta) + 5*rhw_sigma[2]*
sin(2*beta) -
794 2*rhw_sigma[1]*
sin(5*beta) - 4*
fPsi*rhw_sigma[1]*
sin(5*beta) + 2*
pow(
fPsi,2)*rhw_sigma[1]*
sin(5*beta) +
795 rhw_sigma[1]*
sin(7*beta) - 2*
fPsi*rhw_sigma[1]*
sin(7*beta) +
pow(
fPsi,2)*rhw_sigma[1]*
sin(7*beta) -
819 rhw_sigma[1]*
cos(4*beta) +
pow(
fPsi,2)*rhw_sigma[1]*
cos(4*beta) + 2*rhw_sigma[2]*
cos(5*beta) -
820 4*
fPsi*rhw_sigma[2]*
cos(5*beta) + 2*
pow(
fPsi,2)*rhw_sigma[2]*
cos(5*beta) - rhw_sigma[2]*
cos(7*beta) +
821 2*
fPsi*rhw_sigma[2]*
cos(7*beta) -
pow(
fPsi,2)*rhw_sigma[2]*
cos(7*beta) + 3*rhw_sigma[1]*
sin(beta) +
822 2*
fPsi*rhw_sigma[1]*
sin(beta) + 3*
pow(
fPsi,2)*rhw_sigma[1]*
sin(beta) + 5*rhw_sigma[2]*
sin(2*beta) -
824 2*rhw_sigma[1]*
sin(5*beta) - 4*
fPsi*rhw_sigma[1]*
sin(5*beta) + 2*
pow(
fPsi,2)*rhw_sigma[1]*
sin(5*beta) +
825 rhw_sigma[1]*
sin(7*beta) - 2*
fPsi*rhw_sigma[1]*
sin(7*beta) +
pow(
fPsi,2)*rhw_sigma[1]*
sin(7*beta) -
843 (rhw_sigma[1]*(1 +
fPsi + (-1 +
fPsi)*
sin(3*beta)) -
848 (-((1 +
fPsi)*rhw_sigma[2]) - 3*(-1 +
fPsi)*rhw_sigma[2]*
pow(
cos(beta),2)*
sin(beta) +
856 5*(-1 +
pow(
fPsi,2))*rhw_sigma[1]*
cos(2*beta) - rhw_sigma[1]*
cos(4*beta) +
857 pow(
fPsi,2)*rhw_sigma[1]*
cos(4*beta) + 2*rhw_sigma[2]*
cos(5*beta) - 4*
fPsi*rhw_sigma[2]*
cos(5*beta) +
858 2*
pow(
fPsi,2)*rhw_sigma[2]*
cos(5*beta) - rhw_sigma[2]*
cos(7*beta) + 2*
fPsi*rhw_sigma[2]*
cos(7*beta) -
859 pow(
fPsi,2)*rhw_sigma[2]*
cos(7*beta) + 3*rhw_sigma[1]*
sin(beta) + 2*
fPsi*rhw_sigma[1]*
sin(beta) +
861 rhw_sigma[2]*
sin(4*beta) +
pow(
fPsi,2)*rhw_sigma[2]*
sin(4*beta) + 2*rhw_sigma[1]*
sin(5*beta) -
862 4*
fPsi*rhw_sigma[1]*
sin(5*beta) + 2*
pow(
fPsi,2)*rhw_sigma[1]*
sin(5*beta) + rhw_sigma[1]*
sin(7*beta) -
888 jacobianf2_covertex.
Resize(2, 2);
891 STATE CK =
fE/(3.0*(1.0 - 2.0 *
fnu));
892 STATE
CG =
fE/(2.0*(1.0 +
fnu));
893 STATE theta = M_PI_2;
926 (CG*(1 + (1 -
sin(3*beta))/
fPsi +
sin(3*beta))) +
935 (1 + (1 -
sin(3*beta))/
fPsi +
sin(3*beta))))/CG +
940 (CG*(1 + (1 -
sin(3*beta))/
fPsi +
sin(3*beta)));
942 jacobianf2_covertex(1,0) = 0;
944 jacobianf2_covertex(1,1) = -1 - 3*CK*(CPer*(1 +
exp(
fB*k)*
fB*fC*
fR) +
954 STATE CK =
fE/(3.0*(1.0 - 2.0 *
fnu));
969 STATE CK =
fE/(3.0*(1.0 - 2.0 *
fnu));
970 STATE
CG =
fE/(2.0*(1.0 +
fnu));
972 jacobian_vertex = -1 - 3*CK*(CPer*(1 +
exp(
fB*k)*
fB*
fC*
fR) +
981 STATE theta = M_PI_2;
983 jacobian_covertex.
Resize(2, 2);
986 STATE CK =
fE/(3.0*(1.0 - 2.0 *
fnu));
987 STATE
CG =
fE/(2.0*(1.0 +
fnu));
995 (1 + (1 -
sin(3*beta))/
fPsi +
sin(3*beta)),2)/CG +
999 (1 + (1 -
sin(3*beta))/
fPsi +
sin(3*beta)),2)/CG +
1036 (1 + (1 -
sin(3*beta))/
fPsi +
sin(3*beta))))/CG +
1044 jacobian_covertex(1,0) = 0;
1046 jacobian_covertex(1,1) = -1 - 3*CK*(CPer*(1 +
exp(
fB*k)*
fB*fC*
fR) +
1055 STATE II1, JJ2, ggamma, temp1, temp3, f1, f2, phi, sqrtj2,
X, xi, rho, beta;
1062 beta = cylstress[2];
1072 ggamma = 0.5 * (1. + (1. -
sin(3. * beta)) /
fPsi +
sin(3. * beta));
1074 temp1 = (kprev-II1) / (
fR *
F(kprev));
1075 temp3 = (ggamma * sqrtj2) / (
F(kprev));
1077 f1 = sqrtj2 -
F(II1)/ggamma;
1078 f2 = (temp1 * temp1 + temp3 * temp3 - 1);
1080 X = kprev -
fR *
F(kprev);
1085 }
else if (II1 > X ||
IsZero(II1-X) ) {
1098 out <<
"TPZSandlerExtended\n";
1099 out <<
"A: " <<
fA << std::endl;
1100 out <<
"B: " <<
fB << std::endl;
1101 out <<
"C: " <<
fC << std::endl;
1102 out <<
"D: " <<
fD << std::endl;
1103 out <<
"R: " <<
fR << std::endl;
1104 out <<
"W: " <<
fW << std::endl;
1105 out <<
"k_0: " <<
fkappa_0 << std::endl;
1129 return normal_to_failure;
1136 REAL xi_apex =
Apex()/3.0;
1140 for (
int i = 0; i < 3; i++) {
1141 ptr_np1 += sigmatrial[i];
1146 REAL delta_eps_np1 = 0;
1147 REAL
res = xi_apex - ptr_np1;
1150 bool stop_criterion;
1151 int n_iterations = 50;
1153 for (i = 0; i < n_iterations; i++) {
1155 delta_eps_np1 -= res / jac;
1156 p_np1 = ptr_np1 - K * delta_eps_np1;
1157 res = xi_apex - p_np1;
1159 if (stop_criterion) {
1165 if (i == n_iterations) {
1171 throw TPZConvergenceException(tol, n_iterations, res, i,
"TPZSandlerExtended::ProjectApex:: Newton process did not converge.");
1175 for (
int i = 0; i < 3; i++) {
1183 if (loggerConvTest->isDebugEnabled()) {
1184 std::stringstream outfile;
1185 outfile <<
"\n projection over F1 " << endl;
1195 STATE i1_guess =
sqrt(3.0)*rhw_space_s1_s2_s3[0];
1196 STATE beta_guess =
atan2(rhw_space_s1_s2_s3[2],rhw_space_s1_s2_s3[1]);
1197 STATE k_guess =
sqrt(3.0)*rhw_space_s1_s2_s3[0];
1200 par(0, 0) = i1_guess;
1201 par(1, 0) = beta_guess;
1202 par(2, 0) = k_guess;
1209 bool stop_criterion_res;
1210 int max_iterations = 50;
1212 for (it = 0; it < max_iterations; it++) {
1214 Res1(trial_stress, par(0), par(1), par(2), kprev, residue_vec);
1215 for (
int k = 0; k < 3; k++) residue(k, 0) = - 1.0 * residue_vec[k];
1216 residue_norm =
Norm(residue);
1218 if (stop_criterion_res) {
1222 Jacobianf1(trial_stress, par(0), par(1), par(2), jac);
1224 jac_inv.
Multiply(residue, delta_par);
1230 if (it == max_iterations) {
1231 throw TPZConvergenceException(
ftol, max_iterations, residue_norm, it,
"TPZSandlerExtended::ProjectF1:: Newton process did not converge.");
1236 xi = par(0)/
sqrt(3.0);
1241 F1Cyl(xi, beta, f1cyl);
1253 STATE k_guess = kprev;
1254 STATE beta_guess =
atan2(rhw_space_s1_s2_s3[2],rhw_space_s1_s2_s3[1]);
1255 STATE theta_guess =
atan2(hw_space_xi_rho_beta[1],(k_guess/
sqrt(3))-
sqrt(3)*hw_space_xi_rho_beta[0]);
1257 bool cap_vertex_validity_Q = theta_guess <
ftol;
1258 if (cap_vertex_validity_Q) {
1264 if (theta_guess > M_PI_2) {
1267 theta_guess = M_PI_2;
1271 par(0, 0) = theta_guess;
1272 par(1, 0) = beta_guess;
1273 par(2, 0) = k_guess;
1280 bool stop_criterion_res;
1281 int max_iterations = 50;
1283 for (it = 0; it < max_iterations; it++) {
1285 Res2(trial_stress, par(0), par(1), par(2), kprev, residue_vec);
1286 for (
int k = 0; k < 3; k++) residue(k, 0) = - 1.0 * residue_vec[k];
1288 residue_norm =
Norm(residue);
1290 if (stop_criterion_res) {
1294 Jacobianf2(trial_stress, par(0), par(1), par(2), jac);
1296 jac_inv.
Multiply(residue, delta_par);
1299 if (par(0) > M_PI_2) {
1307 if (it == max_iterations) {
1308 throw TPZConvergenceException(ftol, max_iterations, residue_norm, it,
"TPZSandlerExtended::ProjectF2:: Newton process did not converge.");
1318 F2Cyl(theta, beta, kproj, f2cyl);
1329 STATE k_guess = kprev;
1330 STATE beta_guess =
atan2(rhw_space_s1_s2_s3[2],rhw_space_s1_s2_s3[1]);
1331 STATE theta_guess = M_PI_2;
1334 par(0, 0) = beta_guess;
1335 par(1, 0) = k_guess;
1342 bool stop_criterion_res;
1343 int max_iterations = 50;
1345 for (it = 0; it < max_iterations; it++) {
1348 Res2CoVertex(trial_stress, par(0), par(1), kprev, residue_vec);
1349 for (
int k = 0; k < 2; k++) residue(k, 0) = - 1.0 * residue_vec[k];
1351 residue_norm =
Norm(residue);
1353 if (stop_criterion_res) {
1359 jac_inv.
Multiply(residue, delta_par);
1364 if (it == max_iterations) {
1365 throw TPZConvergenceException(
ftol, max_iterations, residue_norm, it,
"TPZSandlerExtended::ProjectCoVertex:: Newton process did not converge.");
1375 F2Cyl(theta, beta, kproj, f2cyl);
1392 bool stop_criterion_res;
1393 int max_iterations = 50;
1395 for (it = 0; it < max_iterations; it++) {
1399 if (stop_criterion_res) {
1405 dk = jac_inv * residue;
1409 if (it == max_iterations) {
1410 throw TPZConvergenceException(
ftol, max_iterations, stop_criterion_res, it,
"TPZSandlerExtended::ProjectVertex:: Newton process did not converge.");
1415 f2cyl[0] = (k -
fR *
F(k))/
sqrt(3.0);
1429 STATE k = kprev, dk;
1432 STATE residue, jac, jac_inv;
1433 bool stop_criterion_res;
1434 int max_iterations = 50;
1436 for (it = 0; it < max_iterations; it++) {
1441 if (stop_criterion_res) {
1446 jac_inv = 1.0 / jac;
1447 dk = - residue * jac_inv;
1451 if (it == max_iterations) {
1452 throw TPZConvergenceException(
ftol, max_iterations, residue, it,
"TPZSandlerExtended::ProjectCapVertex:: Newton process did not converge.");
1459 beta =
atan2(0.0, 0.0);
1463 F2Cyl(theta, beta, kproj, f2cyl);
1475 STATE k_guess = kprev;
1476 STATE beta_guess =
atan2(rhw_space_s1_s2_s3[2],rhw_space_s1_s2_s3[1]);
1479 par(0, 0) = beta_guess;
1480 par(1, 0) = k_guess;
1487 bool stop_criterion_res;
1488 int max_terations = 50;
1490 for (it = 0; it < max_terations; it++) {
1492 Res2CoVertex(trial_stress, par(0), par(1), kprev, residue_vec);
1493 for (
int k = 0; k < 2; k++) residue(k, 0) = - 1.0 * residue_vec[k];
1495 residue_norm =
Norm(residue);
1497 if (stop_criterion_res) {
1503 jac_inv.
Multiply(residue, delta_par);
1507 if (it == max_terations) {
1508 throw TPZConvergenceException(
ftol, max_terations, residue_norm, it,
"TPZSandlerExtended::ProjectCapCoVertex:: Newton process did not converge.");
1518 F2Cyl(theta, beta, kproj, f2cyl);
1525 if (loggerConvTest->isDebugEnabled()) {
1526 std::stringstream outfile;
1527 outfile <<
"\n projection over Ring " << endl;
1531 STATE beta = 0., distnew;
1532 STATE resnorm, disttheta;
1535 for (STATE betaguess = 0; betaguess <= 2 * M_PI; betaguess += M_PI / 20.) {
1536 distnew =
DistF2(sigmatrial, M_PI / 2, betaguess, kprev);
1537 if (
fabs(distnew) <
fabs(disttheta)) {
1540 disttheta = distnew;
1544 int64_t counter = 1;
1545 TPZFMatrix<STATE> xn1(3, 1, 0.), xn(3, 1, 0.), fxn(3, 1, 0.), diff(3, 1, 0.);
1547 xn(0, 0) = M_PI / 2;
1550 while (resnorm >
ftol && counter < 30) {
1552 Jacobianf2(sigmatrial, xn[0], xn[1], xn[2], jac);
1554 Res2(sigmatrial, xn(0), xn(1), xn(2), kprev, fxnvec);
1555 for (
int k = 0; k < 3; k++) fxn(k, 0) = fxnvec[k];
1557 for (
int i = 0; i < 3; i++) {
1564 resnorm =
Norm(sol);
1567 xn1(0, 0) = xn(0, 0);
1568 xn1(1, 0) = xn(1, 0) - sol(1, 0);
1569 xn1(2, 0) = xn(2, 0) - sol(2, 0);
1572 if (loggerConvTest->isDebugEnabled()) {
1573 std::stringstream outfile;
1574 outfile << counter <<
" " <<
log(resnorm) << endl;
1588 if (counter == 30) {
1595 STATE thetasol, betasol, ksol;
1602 F2Cyl(thetasol, betasol, ksol, f2cyl);
1619 STATE theta = 0., beta = 0., distnew;
1620 STATE resnorm, disttheta;
1622 STATE betaconst = 0;
1623 for (STATE thetaguess = 0; thetaguess <= M_PI; thetaguess += M_PI / 20.) {
1624 distnew =
DistF2(sigmatrial, thetaguess, betaconst, kprev);
1625 if (
fabs(distnew) <
fabs(disttheta)) {
1628 disttheta = distnew;
1634 TPZFNMatrix<3, STATE> xn1(3, 1, 0.), xn(3, 1, 0.), sol(3, 1, 0.), fxn(3, 1, 0.), diff(3, 1, 0.);
1638 while (resnorm >
ftol && counter < 30) {
1640 Jacobianf2(sigmatrial, xn(0), xn(1), xn(2), jac);
1642 Res2(sigmatrial, xn(0), xn(1), xn(2), kprev, fxnvec);
1643 for (
int k = 0; k < 3; k++) fxn(k, 0) = fxnvec[k];
1644 for (
int i = 0; i < 3; i++) {
1651 resnorm =
Norm(sol);
1654 xn1(0, 0) = xn(0, 0) - sol(0, 0);
1655 xn1(1, 0) = xn(1, 0);
1656 xn1(2, 0) = xn(2, 0) - sol(2, 0);
1665 STATE thetasol, betasol, ksol;
1676 F2Cyl(thetasol, betasol, ksol, f2cyl);
1681 STATE sig1, sig2, sig3;
1685 I1 = sig1 + sig2 + sig3;
1690 STATE sig1, sig2, sig3;
1694 J2 = (2. * sig1 * sig2 +
pow(sig1 + (-sig1 - sig2 - sig3) / 3., 2.) +
1695 pow(sig2 + (-sig1 - sig2 - sig3) / 3., 2.) + 2 * sig1 * sig3 + 2. * sig2 * sig3 +
1696 pow((-sig1 - sig2 - sig3) / 3. + sig3, 2.)) / 2.;
1700 STATE sig1, sig2, sig3, s1, s2, s3;
1705 s1 = sig1 - (1. / 3.)*(sig1 + sig2 + sig3);
1706 s2 = sig2 - (1. / 3.)*(sig1 + sig2 + sig3);
1707 s3 = sig3 - (1. / 3.)*(sig1 + sig2 + sig3);
1709 stress[0] = s1 * (2 *
fG) +
fK * (sig1 + sig2 + sig3);
1710 stress[1] = s2 * (2 *
fG) +
fK * (sig1 + sig2 + sig3);
1711 stress[2] = s3 * (2 *
fG) +
fK * (sig1 + sig2 + sig3);
1715 STATE sig1, sig2, sig3, s1, s2, s3;
1720 s1 = sig1 - (1. / 3.)*(sig1 + sig2 + sig3);
1721 s2 = sig2 - (1. / 3.)*(sig1 + sig2 + sig3);
1722 s3 = sig3 - (1. / 3.)*(sig1 + sig2 + sig3);
1724 strain[0] = s1 / (2. *
fG)+(sig1 + sig2 + sig3) / (9. *
fK);
1725 strain[1] = s2 / (2. *
fG)+(sig1 + sig2 + sig3) / (9. *
fK);
1726 strain[2] = s3 / (2. *
fG)+(sig1 + sig2 + sig3) / (9. *
fK);
1737 bool require_tangent_Q =
true;
1739 require_tangent_Q =
false;
1744 if (!(tangent->
Rows() == 6 && tangent->
Cols() == 6)) {
1745 std::cerr <<
"Unable to compute the tangent operator. Required tangent array dimensions are 6x6." << std::endl;
1750 if (require_tangent_Q) {
1754 STATE trial_I1, I1proj;
1764 if ((yield[1] <= 0 && trial_I1 <= kprev) || (yield[0] <= 0 && trial_I1 > kprev)) {
1767 stressnext = trial_stress;
1771 if (yield[1] > 0 && trial_I1 < kprev) {
1773 ProjectF2(trial_stress, kprev, stressnext, knext);
1776 ProjectF1(trial_stress, kprev, stressnext, knext);
1778 if (I1proj < knext) {
1780 ProjectRing(trial_stress, kprev, stressnext, knext);
1784 for (
int i = 0; i < 3; i++) {
1785 deltastress[i] = trial_stress[i] - stressnext[i];
1790 for (
int i = 0; i < 3; i++) {
1791 epspnext[i] = epsp[i] + delepsp[i];
1798 bool require_gradient_Q = (gradient != NULL);
1801 if (require_gradient_Q) {
1803 if (!(gradient->
Rows() == 3 && gradient->
Cols() == 3)) {
1804 std::cerr <<
"Unable to compute the gradient operator. Required gradient array dimensions are 3x3." << std::endl;
1812 STATE I1 = sigtrial[0] + sigtrial[1] + sigtrial[2];
1813 REAL J2 = (1.0/3.0) * (sigtrial[0]*sigtrial[0] + sigtrial[1]*sigtrial[1] + sigtrial[2]*sigtrial[2] - sigtrial[1]*sigtrial[2] - sigtrial[0]*sigtrial[2] - sigtrial[0]*sigtrial[1]);
1818 if (yield[1] > 0.0 ||
IsZero(yield[1]) ) {
1822 ProjectF2(sigtrial, kprev, sigproj, kproj);
1824 STATE proj_i1 = sigproj[0] + sigproj[1] + sigproj[2];
1826 if (proj_i1 > kproj) {
1827 std::ostringstream stringbuilder(
"TPZSandlerExtended::ProjectSigma: proj_i1 > kproj with proj_i1 = ");
1828 stringbuilder << proj_i1 <<
" and kproj = " << kproj <<
".";
1832 if (require_gradient_Q) {
1841 if (require_gradient_Q) {
1848 if (yield[0] > 0.0 ||
IsZero(yield[0]) ) {
1850 bool failure_validity_Q = I1 > kprev ||
IsZero(I1 - kprev);
1851 if (failure_validity_Q) {
1852 STATE normal_to_f1_at_last_k =
NormalToF1(I1, kprev);
1853 bool covertex_validity_Q = normal_to_f1_at_last_k <
sqrt(J2) ||
IsZero(normal_to_f1_at_last_k -
sqrt(J2));
1854 if (covertex_validity_Q) {
1857 if (require_gradient_Q) {
1863 REAL apex_i1 =
Apex();
1864 bool inside_apex_region_Q = I1 > apex_i1 ||
IsZero(I1 - apex_i1);
1865 if (inside_apex_region_Q) {
1866 STATE normal_to_f1_at_appex =
NormalToF1(I1, apex_i1);
1867 bool apex_validity_Q = normal_to_f1_at_appex >
sqrt(J2) ||
IsZero(normal_to_f1_at_appex -
sqrt(J2));
1868 if (apex_validity_Q) {
1872 if (require_gradient_Q) {
1880 ProjectF1(sigtrial, kprev, sigproj, kproj);
1881 if (require_gradient_Q) {
1889 ProjectF1(sigtrial, kprev, sigproj, kproj);
1890 if (require_gradient_Q) {
1904 if (require_gradient_Q) {
1919 STATE fv =
F(kproj);
1920 STATE CK =
fE/(3.0*(1.0 - 2.0 *
fnu));
1921 STATE
CG =
fE/(2.0*(1.0 +
fnu));
1929 STATE i1v =
sqrt(3)*hw_space_xi_rho_beta[0];
1930 STATE ratio = (k-i1v)/(
fR*fv);
1932 bool cap_vertex_validity_Q =
fabs(ratio - 1.0) <=
ftol;
1933 if (cap_vertex_validity_Q) {
1938 STATE theta =
acos(ratio);
1939 STATE beta =
atan2(rhw_space_s1_s2_s3[2],rhw_space_s1_s2_s3[1]);
1943 Jacobianf2(trial_stress, theta, beta, k, jac);
1955 d_res_d_sig_trial(1,0) = 0;
1961 d_res_d_sig_trial(2,0) =
sqrt(3);
1962 d_res_d_sig_trial(2,1) = 0;
1963 d_res_d_sig_trial(2,2) = 0;
2000 jac_inv.
Multiply(d_res_d_sig_trial, d_theta_beta_kappa_d_sig_trial);
2001 d_sig_proj_d_theta_beta_kappa.
Multiply(d_theta_beta_kappa_d_sig_trial, d_sig_proj_d_sig_trial);
2002 d_sig_proj_d_sig_trial.
Multiply(Rot, *gradient);
2013 STATE fv =
F(kproj);
2014 STATE CK =
fE/(3.0*(1.0 - 2.0 *
fnu));
2015 STATE
CG =
fE/(2.0*(1.0 +
fnu));
2028 jac_inv = 1.0 / jac;
2036 d_res_d_sig_trial(0,0) =
sqrt(3);
2037 d_res_d_sig_trial(0,1) =0;
2038 d_res_d_sig_trial(0,2) =0;
2041 d_sig_proj_d_kappa(0,0) = (1 +
exp(
fB*k)*
fB*
fC*
fR*
cos(theta))/3.;
2042 d_sig_proj_d_kappa(1,0) = (1 +
exp(
fB*k)*
fB*
fC*
fR*
cos(theta))/3.;
2043 d_sig_proj_d_kappa(2,0) = (1 +
exp(
fB*k)*
fB*
fC*
fR*
cos(theta))/3.;
2047 d_kappa_d_sig_trial = jac_inv * d_res_d_sig_trial;
2048 d_sig_proj_d_kappa.
Multiply(d_kappa_d_sig_trial, d_sig_proj_d_sig_trial);
2049 d_sig_proj_d_sig_trial.
Multiply(Rot, *gradient);
2059 STATE fv =
F(kproj);
2060 STATE CK =
fE/(3.0*(1.0 - 2.0 *
fnu));
2061 STATE
CG =
fE/(2.0*(1.0 +
fnu));
2069 STATE i1v =
sqrt(3)*hw_space_xi_rho_beta[0];
2070 STATE theta = M_PI_2;
2071 STATE beta =
atan2(rhw_space_s1_s2_s3[2],rhw_space_s1_s2_s3[1]);
2084 d_res_d_sig_trial(0,0) = 0;
2091 d_res_d_sig_trial(1,0) =
sqrt(3);
2092 d_res_d_sig_trial(1,1) = 0;
2093 d_res_d_sig_trial(1,2) = 0;
2099 d_sig_proj_d_beta_kappa(0,1) = (1.0/3.0) - (4*
exp(
fB*k)*
fB*
fC*
fPsi*
cos(beta))/
2120 jac_inv.
Multiply(d_res_d_sig_trial, d_beta_kappa_d_sig_trial);
2121 d_sig_proj_d_beta_kappa.
Multiply(d_beta_kappa_d_sig_trial, d_sig_proj_d_sig_trial);
2122 d_sig_proj_d_sig_trial.
Multiply(Rot, *gradient);
2133 STATE fv =
F(kproj);
2134 STATE CK =
fE/(3.0*(1.0 - 2.0 *
fnu));
2135 STATE
CG =
fE/(2.0*(1.0 +
fnu));
2142 STATE i1 =
sqrt(3.0)*rhw_space_s1_s2_s3[0];
2143 STATE beta =
atan2(rhw_space_s1_s2_s3[2],rhw_space_s1_s2_s3[1]);
2158 d_res_d_sig_trial(0,0) = -2/(3.*
sqrt(3)*CK);
2162 d_res_d_sig_trial(1,0) = 0;
2169 d_res_d_sig_trial(2,0) =
sqrt(3);
2170 d_res_d_sig_trial(2,1) = 0;
2171 d_res_d_sig_trial(2,2) = 0;
2177 d_sig_proj_d_i1_beta_kappa(0,2) = 0;
2185 d_sig_proj_d_i1_beta_kappa(1,2) = 0;
2193 d_sig_proj_d_i1_beta_kappa(2,2) = 0;
2197 jac_inv.
Multiply(d_res_d_sig_trial, d_i1_beta_kappa_d_sig_trial);
2198 d_sig_proj_d_i1_beta_kappa.
Multiply(d_i1_beta_kappa_d_sig_trial, d_sig_proj_d_sig_trial);
2199 d_sig_proj_d_sig_trial.
Multiply(Rot, *gradient);
2218 I1 = sigtrial[0] + sigtrial[1] + sigtrial[2];
2221 bool threeEigEqual = (
fabs(sigtrial[0] - sigtrial[1]) <
ftol &&
fabs(sigtrial[1] - sigtrial[2]) <
ftol);
2225 if (yield[1] > 0. && !threeEigEqual) {
2227 if (logger->isDebugEnabled()) {
2228 std::stringstream sout;
2229 sout <<
"Projecting on F2, distinct eigenvalues " << sigtrial;
2233 ProjectF2(sigtrial, kprev, sigproj, kproj);
2239 Jacobianf2(sigtrial, theta, beta, kproj, jacF2);
2240 jacF2.Solve_LU(&dbetadsigtrial);
2241 DF2Cart(theta, beta, kproj, DF2cart);
2242 DF2cart.
Multiply(dbetadsigtrial, GradSigma);
2244 }
else if (yield[1] > 0. && threeEigEqual) {
2246 if (logger->isDebugEnabled()) {
2247 std::stringstream sout;
2248 sout <<
"Projecting on F2, equal eigenvalues " << sigtrial;
2260 if (logger->isDebugEnabled()) {
2261 std::stringstream sout;
2262 sout <<
"Surface parameters for sigproj = " << sigproj <<
" kproj " << kproj <<
" theta " << theta;
2267 sigtrialIJ[0] = sigtrial[0] + sigtrial[1] + sigtrial[2];
2268 DDistF2IJ(sigtrialIJ, theta, kproj, kprev, ddistf2);
2270 if (logger->isDebugEnabled()) {
2271 std::stringstream sout;
2272 sout <<
"Derivative of the distance function (should be zero) = " << ddistf2;
2280 sigtrialIJFAD[0].val() = sigtrialIJ[0];
2281 sigtrialIJFAD[1].val() = sigtrialIJ[1];
2282 DDistF2IJ(sigtrialIJFAD, thetafad, kprojfad, kprev, ddistf2fad);
2283 JacThetaK(0, 0) = ddistf2fad[0].d(0);
2284 JacThetaK(0, 1) = ddistf2fad[0].d(1);
2285 JacThetaK(1, 0) = ddistf2fad[1].d(0);
2286 JacThetaK(1, 1) = ddistf2fad[1].d(1);
2291 sigtrialIJFAD[0].val() = sigtrialIJ[0];
2292 sigtrialIJFAD[0].fastAccessDx(0) = 1.;
2293 sigtrialIJFAD[1].val() = sigtrialIJ[1];
2294 sigtrialIJFAD[1].fastAccessDx(1) = 1.;
2295 DDistF2IJ(sigtrialIJFAD, thetafad, kprojfad, kprev, ddistf2fad);
2296 JacSigtrIJ(0, 0) = ddistf2fad[0].d(0);
2297 JacSigtrIJ(0, 1) = ddistf2fad[0].d(1);
2298 JacSigtrIJ(1, 0) = ddistf2fad[1].d(0);
2299 JacSigtrIJ(1, 1) = ddistf2fad[1].d(1);
2306 JacSigprojThetaK(0, 0) = sigprojIJFAD[0].d(0);
2307 JacSigprojThetaK(0, 1) = sigprojIJFAD[0].d(1);
2308 JacSigprojThetaK(1, 0) = sigprojIJFAD[1].d(0);
2309 JacSigprojThetaK(1, 1) = sigprojIJFAD[1].d(1);
2312 if (logger->isDebugEnabled()) {
2313 std::stringstream sout;
2314 sout <<
"Derivative of the distanceIJ " << ddistf2 << std::endl;
2315 JacThetaK.
Print(
"Derivative of distanceIJ with respect to theta, K", sout);
2316 JacSigtrIJ.Print(
"Derivative of distanceIJ with respect to sigtialIJ", sout);
2317 sout <<
"SigmaProjected IJ " << sigprojIJ << std::endl;
2318 JacSigprojThetaK.Print(
"Derivative of sigproj with respect to theta K", sout);
2322 std::list<int64_t> singular;
2323 JacThetaK.Solve_LU(&JacSigtrIJ, singular);
2325 if (logger->isDebugEnabled()) {
2326 std::stringstream sout;
2327 sout <<
"Negative of derivative of Theta,K with respect to sigtrIJ" << std::endl;
2328 JacSigtrIJ.Print(
"Derivative = ", sout);
2333 JacSigprojThetaK.Multiply(JacSigtrIJ, dsigprojdsigtr);
2334 dsigprojdsigtr *= -1.;
2336 if (logger->isDebugEnabled()) {
2337 std::stringstream sout;
2338 dsigprojdsigtr.Print(
"Derivative of SigprojIJ with respect to SigtrialIJ", sout);
2342 for (
int i = 0; i < 3; i++) {
2343 for (
int j = 0; j < 3; j++) {
2344 GradSigma(i, j) = dsigprojdsigtr(0, 0) / 3.;
2346 GradSigma(i, j) += dsigprojdsigtr(1, 1)*2. / 3.;
2348 GradSigma(i, j) -= dsigprojdsigtr(1, 1) / 3.;
2359 if (yield[0] > 0.) {
2361 if (logger->isDebugEnabled()) {
2362 std::stringstream sout;
2363 sout <<
"Projecting on F1";
2367 ProjectF1(sigtrial, kprev, sigproj, kproj);
2372 if (
fabs(yieldcopy[0]) > 1.e-3) {
2379 for (
int i = 0; i < 3; i++) {
2391 if (
fabs(theta) - M_PI_2 > 1.e-8) {
2396 for (
int i = 0; i < 3; i++) dbetadsigtrial(0, i) = 0.;
2397 Jacobianf2(sigtrial, theta, beta, kproj, jacF2);
2398 for (
int i = 0; i < 3; i++) {
2403 jacF2.Solve_LU(&dbetadsigtrial);
2404 DF2Cart(theta, beta, kproj, DF2cart);
2405 for (
int i = 0; i < 3; i++) DF2cart(i, 0) = 0.;
2406 DF2cart.
Multiply(dbetadsigtrial, GradSigma);
2416 jacF1.Solve_LU(&dbetadsigtrial);
2418 DF1cart.
Multiply(dbetadsigtrial, GradSigma);
2425 if (logger->isDebugEnabled()) {
2426 std::stringstream sout;
2427 sout <<
"Elastic Behaviour";
2449 STATE s3beta =
sin(3. * beta);
2450 STATE c3beta =
cos(3. * beta);
2451 STATE Gamma = (1 + s3beta)+(1. - s3beta) /
fPsi;
2452 STATE DGamma = 3. * c3beta * (1. - 1. /
fPsi);
2453 STATE SQR3 =
sqrt(3.);
2454 STATE FFI =
fA -
fPhi * SQR3 * xi -
fC *
exp(
fB * SQR3 * xi);
2457 deriv(0, 0) = (-2 * (
fG * Gamma - 6 *
fK * (SQR3 *
fA *
fB - SQR3 *
fB * FFI + SQR3 *
fPhi - 3 *
fB *
fPhi * xi) *
Cos(beta))) / (3. * SQR3 *
fG *
fK * Gamma);
2458 deriv(1, 0) = (4 * (FFI - NN)*(DGamma *
Cos(beta) + Gamma *
Sin(beta))) / (SQR3 *
fG * Gamma * Gamma);
2460 deriv(0, 1) = (-2 * (SQR3 *
fG * Gamma + 9 *
fK * (
fA *
fB +
fPhi -
fB * (FFI + SQR3 *
fPhi * xi)) *
Cos(beta) -
2461 9 *
fK * (SQR3 *
fA *
fB + SQR3 *
fPhi -
fB * (SQR3 * FFI + 3 *
fPhi * xi)) *
Sin(beta))) / (9. *
fG *
fK * Gamma);
2462 deriv(1, 1) = (-2 * (FFI - NN)*((SQR3 * DGamma + 3 * Gamma) *
Cos(beta) + (-3 * DGamma + SQR3 * Gamma) *
Sin(beta))) / (3. *
fG * Gamma * Gamma);
2464 deriv(0, 2) = (-2 * (SQR3 *
fG * Gamma + 9 *
fK * (
fA *
fB +
fPhi -
fB * (FFI + SQR3 *
fPhi * xi)) *
Cos(beta) +
2465 9 *
fK * (SQR3 *
fA *
fB + SQR3 *
fPhi -
fB * (SQR3 * FFI + 3 *
fPhi * xi)) *
Sin(beta))) / (9. *
fG *
fK * Gamma);
2466 deriv(1, 2) = (-2 * (FFI - NN)*((SQR3 * DGamma - 3 * Gamma) *
Cos(beta) + (3 * DGamma + SQR3 * Gamma) *
Sin(beta))) / (3. *
fG * Gamma * Gamma);
2472 STATE s3beta =
sin(3. * beta);
2473 STATE c3beta =
cos(3. * beta);
2474 STATE Gamma = (1 + s3beta)+(1. - s3beta) /
fPsi;
2475 STATE DGamma = 3. * c3beta * (1. - 1. /
fPsi);
2476 STATE SQR3 =
sqrt(3.);
2479 deriv(0, 0) = (-4 * (FFK -
fN) *
Cos(beta) *
Cos(theta)) / (SQR3 *
fG * Gamma) + (2 * FFK *
fR *
Sin(theta)) / (9. *
fK);
2480 deriv(1, 0) = (4 * (FFK -
fN)*(DGamma *
Cos(beta) + Gamma *
Sin(beta)) *
Sin(theta)) / (SQR3 *
fG * Gamma * Gamma);
2483 deriv(0, 1) = (2 * (3 * SQR3 *
fK * (FFK -
fN) *
Cos(beta) *
Cos(theta) - 9 *
fK * (FFK -
fN) *
Cos(theta) *
Sin(beta) + FFK *
fG *
fR * Gamma *
Sin(theta))) / (9. *
fG *
fK * Gamma);
2484 deriv(1, 1) = (-2 * (FFK -
fN)*((SQR3 * DGamma + 3 * Gamma) *
Cos(beta) + (-3 * DGamma + SQR3 * Gamma) *
Sin(beta)) *
Sin(theta)) / (3. *
fG * Gamma * Gamma);
2487 deriv(0, 2) = (2 * (3 * SQR3 *
fK * (FFK -
fN) *
Cos(beta) *
Cos(theta) + 9 *
fK * (FFK -
fN) *
Cos(theta) *
Sin(beta) + FFK *
fG *
fR * Gamma *
Sin(theta))) / (9. *
fG *
fK * Gamma);
2488 deriv(1, 2) = (-2 * (FFK -
fN)*((SQR3 * DGamma - 3 * Gamma) *
Cos(beta) + (3 * DGamma + SQR3 * Gamma) *
Sin(beta)) *
Sin(theta)) / (3. *
fG * Gamma * Gamma);
2495 STATE deltaxi = 0.4;
2496 STATE deltabeta = 0.05;
2497 STATE dist0 =
DistF1(sigmatrial, xi, beta);
2502 for (
int i = 1; i <= 10; i++) {
2503 STATE diffxi = deltaxi * i / 10.;
2504 STATE xinext = xi + diffxi;
2505 STATE diffbeta = deltabeta * i / 10.;
2506 STATE betanext = beta + diffbeta;
2507 STATE distnext =
DistF1(sigmatrial, xinext, betanext);
2508 STATE distguess = dist0 + jac(0, 0) * diffxi + jac(1, 0) * diffbeta;
2509 xnorm[i - 1] =
sqrt(diffxi * diffxi + diffbeta * diffbeta);
2510 errnorm[i - 1] =
fabs(distnext - distguess);
2517 STATE deltaxi = 0.4;
2518 STATE deltabeta = 0.05;
2525 for (
int i = 1; i <= 10; i++) {
2526 STATE diffxi = deltaxi * i / 10.;
2527 STATE xinext = xi + diffxi;
2528 STATE diffbeta = deltabeta * i / 10.;
2531 STATE betanext = beta + diffbeta;
2532 DDistFunc1(sigmatrial, xinext, betanext, resid);
2535 xnorm[i - 1] =
Norm(diff);
2536 errnorm[i - 1] =
Norm(resid - residguess);
2544 deltasigma[1] *= -1.;
2545 deltasigma[2] *= 0.7;
2553 for (
int i = 1; i <= 10; i++) {
2554 for (
int j = 0; j < 3; j++) diff(j) = deltasigma[j] * i / 10.;
2556 for (
int j = 0; j < 3; j++) sigmanext[j] = sigmatrial[j] + diff(j);
2560 xnorm[i - 1] =
Norm(diff);
2561 errnorm[i - 1] =
Norm(resid - residguess);
2568 for (
int i = 1; i < xnorm.
size(); i++) {
2569 convergence[i - 1] =
log(errnorm[i] / errnorm[i - 1]) /
log(xnorm[i] / xnorm[i - 1]);
2575 STATE deltatheta = 0.4;
2576 STATE deltabeta = 0.05;
2578 STATE dist0 =
DistF2(sigmatrial, theta, beta, k);
2581 Res2(sigmatrial, theta, beta, k, kprev, fxnvec);
2582 for (
int kk = 0; kk < 3; kk++) jac(kk, 0) = fxnvec[kk];
2586 for (
int i = 1; i <= 10; i++) {
2587 STATE difftheta = deltatheta * i / 10.;
2588 STATE thetanext = theta + difftheta;
2589 STATE diffbeta = deltabeta * i / 10.;
2590 STATE betanext = beta + diffbeta;
2591 STATE diffk = deltak * i / 10.;
2592 STATE knext = k + deltak;
2593 STATE distnext =
DistF2(sigmatrial, thetanext, betanext, knext);
2594 STATE distguess = dist0 + jac(0, 0) * difftheta + jac(1, 0) * diffbeta + jac(2, 0) * diffk;
2595 xnorm[i - 1] =
sqrt(difftheta * difftheta + diffbeta * diffbeta + diffk * diffk);
2596 errnorm[i - 1] =
fabs(distnext - distguess);
2603 STATE deltatheta = 0.4;
2604 STATE deltabeta = 0.05;
2609 Res2(sigmatrial, theta, beta, k, kprev, fxnvec);
2610 for (
int kk = 0; kk < 3; kk++) res0(kk, 0) = fxnvec[kk];
2615 for (
int i = 1; i <= 10; i++) {
2616 STATE difftheta = deltatheta * i / 10.;
2617 STATE thetanext = theta + difftheta;
2618 STATE diffbeta = deltabeta * i / 10.;
2619 STATE betanext = beta + diffbeta;
2620 STATE diffk = deltak * i / 10.;
2621 STATE knext = k + diffk;
2622 diff(0) = difftheta;
2626 Res2(sigmatrial, thetanext, betanext, knext, kprev, fxnvec);
2627 for (
int k = 0; k < 3; k++) resid(k, 0) = fxnvec[k];
2631 xnorm[i - 1] =
Norm(diff);
2632 errnorm[i - 1] =
Norm(resid - residguess);
2642 deltasigma[1] *= -1.;
2643 deltasigma[2] *= 0.7;
2648 Res2(sigmatrial, theta, beta, k, kprev, fxnvec);
2649 for (
int kk = 0; kk < 3; kk++) res0(kk, 0) = fxnvec[kk];
2654 for (
int i = 1; i <= 10; i++) {
2655 for (
int j = 0; j < 3; j++) diff(j) = deltasigma[j] * i / 10.;
2657 for (
int j = 0; j < 3; j++) sigmanext[j] = sigmatrial[j] + diff(j);
2659 Res2(sigmanext, theta, beta, k, kprev, fxnvec);
2660 for (
int k = 0; k < 3; k++) resid(k, 0) = fxnvec[k];
2664 xnorm[i - 1] =
Norm(diff);
2665 errnorm[i - 1] =
Norm(resid - residguess);
2678 REAL dist1 =
dist(cart, Cart2);
2679 REAL dist2 =
dist(HWCart, HWCart2);
2680 cout << __FUNCTION__ <<
" dist1 = " << dist1 <<
" dist2 = " << dist2 << endl;
2687 STATE s3beta =
sin(3. * beta);
2688 STATE c3beta =
cos(3. * beta);
2689 STATE Gamma = (1 + s3beta)+(1. - s3beta) /
fPsi;
2690 STATE DGamma = 3. * c3beta * (1. - 1. /
fPsi);
2691 STATE SQR3 =
sqrt(3.);
2692 STATE FFI =
fA -
fPhi * SQR3 * xi -
fC *
exp(
fB * SQR3 * xi);
2694 DF1(0, 0) = 1 / SQR3 + (4 * (-(SQR3 *
fPhi) - SQR3 *
fB * (
fA - FFI - SQR3 *
fPhi * xi)) *
Cos(beta)) /
2696 DF1(1, 0) = 1 / SQR3 + (4 * (-(SQR3 *
fPhi) -
2697 SQR3 *
fB * (
fA - FFI - SQR3 *
fPhi * xi)) *
Sin(beta - M_PI / 6.)) / (SQR3 * Gamma);
2699 1 / SQR3 - (4 * (-(SQR3 *
fPhi) - SQR3 *
fB * (
fA - FFI - SQR3 *
fPhi * xi)) *
2700 Sin(beta + M_PI / 6.)) / (SQR3 * Gamma);
2702 DF1(0, 1) = (-4 * DGamma * (FFI -
fN) *
Cos(beta)) / (SQR3 * Gamma * Gamma) -
2703 (4 * (FFI -
fN) *
Sin(beta)) / (SQR3 * Gamma);
2704 DF1(1, 1) = (4 * (FFI -
fN) *
Cos(beta - M_PI / 6.)) / (SQR3 * Gamma) -
2705 (4 * DGamma * (FFI -
fN) *
Sin(beta - M_PI / 6.)) / (SQR3 * Gamma * Gamma);
2707 DF1(2, 1) = (-4 * (FFI -
fN) *
Cos(beta + M_PI / 6.)) / (SQR3 * Gamma) +
2708 (4 * DGamma * (FFI -
fN) *
Sin(beta + M_PI / 6.)) / (SQR3 * Gamma * Gamma);
2714 STATE s3beta =
sin(3. * beta);
2715 STATE c3beta =
cos(3. * beta);
2716 STATE Gamma = (1 + s3beta)+(1. - s3beta) /
fPsi;
2717 STATE DGamma = 3. * c3beta * (1. - 1. /
fPsi);
2718 STATE SQR3 =
sqrt(3.);
2721 DF2(0, 0) = (4 * (FFK -
fN) *
Cos(beta) *
Cos(theta)) / (SQR3 * Gamma) - (FFK *
fR *
Sin(theta)) / 3.;
2722 DF2(1, 0) = (4 * (FFK -
fN) *
Cos(theta) *
Sin(beta - M_PI / 6.)) / (SQR3 * Gamma) - (FFK *
fR *
Sin(theta)) / 3.;
2723 DF2(2, 0) = (4 * (-FFK +
fN) *
Cos(theta) *
Sin(beta + M_PI / 6.)) / (SQR3 * Gamma) - (FFK *
fR *
Sin(theta)) / 3.;
2725 DF2(0, 1) = (-4 * (FFK -
fN)*(DGamma *
Cos(beta) + Gamma *
Sin(beta)) *
Sin(theta)) / (SQR3 * Gamma * Gamma);
2726 DF2(1, 1) = (4 * (FFK -
fN)*(Gamma *
Cos(beta - M_PI / 6.) - DGamma *
Sin(beta - M_PI / 6.)) *
Sin(theta)) / (SQR3 * Gamma * Gamma);
2727 DF2(2, 1) = (-4 * (FFK -
fN)*(Gamma *
Cos(beta + M_PI / 6.) - DGamma *
Sin(beta + M_PI / 6.)) *
Sin(theta)) / (SQR3 * Gamma * Gamma);
2730 (
fR * Gamma *
Cos(theta) + 4 * SQR3 *
Cos(beta) *
Sin(theta))) / (3. * Gamma);
2732 (
fR * Gamma *
Cos(theta) + 4 * SQR3 *
Sin(beta - M_PI / 6.) *
Sin(theta))) / (3. * Gamma);
2734 (
fR * Gamma *
Cos(theta) - 4 * SQR3 *
Sin(beta + M_PI / 6.) *
Sin(theta))) / (3. * Gamma);
2738 STATE deltaxi = 0.4;
2739 STATE deltabeta = 0.05;
2743 F1Cyl(xi, beta, sigHWCyl);
2745 for (
int i = 0; i < 3; i++) {
2746 res0(i) = sigCart[i];
2751 for (
int i = 1; i <= 10; i++) {
2752 STATE diffxi = deltaxi * i / 10.;
2753 STATE xinext = xi + diffxi;
2754 STATE diffbeta = deltabeta * i / 10.;
2757 STATE betanext = beta + diffbeta;
2758 F1Cyl(xinext, betanext, sigHWCyl);
2760 for (
int ii = 0; ii < 3; ii++) {
2761 resid(ii) = sigCart[ii];
2765 xnorm[i - 1] =
Norm(diff);
2766 errnorm[i - 1] =
Norm(resid - residguess);
2771 STATE deltatheta = 0.4;
2772 STATE deltabeta = 0.05;
2778 F2Cyl(theta, beta, k, sigHWCyl);
2780 for (
int i = 0; i < 3; i++) {
2781 res0(i) = sigCart[i];
2785 for (
int i = 1; i <= 10; i++) {
2786 STATE difftheta = deltatheta * i / 10.;
2787 STATE thetanext = theta + difftheta;
2788 STATE diffbeta = deltabeta * i / 10.;
2789 STATE betanext = beta + diffbeta;
2790 STATE diffk = deltak * i / 10.;
2791 STATE knext = k + diffk;
2792 diff(0) = difftheta;
2795 F2Cyl(thetanext, betanext, knext, sigHWCyl);
2797 for (
int ii = 0; ii < 3; ii++) {
2798 resid(ii) = sigCart[ii];
2802 xnorm[i - 1] =
Norm(diff);
2803 errnorm[i - 1] =
Norm(resid - residguess);
2810 deltasigma[1] = -4.e-6;
2811 deltasigma[2] = -4.e-6;
2821 for (
int j = 0; j < 3; j++) res0(j) = sigproj[j];
2824 for (
int i = 1; i <= 10; i++) {
2826 for (
int j = 0; j < 3; j++) {
2827 diffsigma[j] = deltasigma[j] * i / 10.;
2828 nextsigma[j] = sigtrial[j] + diffsigma[j];
2829 diff(j) = diffsigma[j];
2833 ProjectSigma(nextsigma, kprev, sigproj, kproj, m_type);
2834 for (
int j = 0; j < 3; j++) resid(j) = sigproj[j];
2835 xnorm[i - 1] =
Norm(diff);
2836 errnorm[i - 1] =
Norm(resid - residguess);
2844 deltasigma[1] *= 3.;
2845 deltasigma[2] *= -2.;
2849 ProjectF1(sigtrial, kprev, sigproj, kproj);
2857 jacF1.Solve_LU(&gradF1);
2861 for (
int i = 1; i <= 10; i++) {
2863 for (
int j = 0; j < 3; j++) {
2864 diffsigma[j] = deltasigma[j] * i / 10.;
2865 nextsigma[j] = sigtrial[j] + diffsigma[j];
2866 diff(j) = diffsigma[j];
2868 jac.Multiply(diff, residguess);
2870 ProjectF1(nextsigma, kprev, sigproj, kproj);
2874 xnorm[i - 1] =
Norm(diff);
2875 errnorm[i - 1] =
Norm(resid - residguess);
2882 deltasigma[1] *= 3.;
2883 deltasigma[2] *= -2.;
2885 TPZFNMatrix<9, STATE> jac(3, 3), jacF1(2, 2), gradF1(2, 3), DF1cart(2, 3), GradSigma(3, 3);
2887 ProjectF1(sigtrial, kprev, sigproj, kproj);
2890 res0(0) = sigproj[0];
2892 res0(1) = sigproj[1];
2893 res0(2) = sigproj[2];
2897 jacF1.Solve_LU(&gradF1);
2899 DF1cart.Multiply(gradF1, GradSigma);
2905 for (
int i = 1; i <= 10; i++) {
2907 for (
int j = 0; j < 3; j++) {
2908 diffsigma[j] = deltasigma[j] * i / 10.;
2909 nextsigma[j] = sigtrial[j] + diffsigma[j];
2910 diff(j) = diffsigma[j];
2912 jac.Multiply(diff, residguess);
2914 ProjectF1(nextsigma, kprev, sigproj, kproj);
2915 resid(0) = sigproj[0];
2916 resid(1) = sigproj[1];
2917 resid(2) = sigproj[2];
2918 xnorm[i - 1] =
Norm(diff);
2919 errnorm[i - 1] =
Norm(resid - residguess);
2929 deltasigma[1] = -4.e-6;
2930 deltasigma[2] = -4.e-6;
2932 TPZFNMatrix<9, STATE> jac(3, 3), jacF2(3, 3), gradF2(3, 3), DF2cart(3, 3), GradSigma(3, 3);
2934 ProjectF2(sigtrial, kprev, sigproj, kproj);
2937 res0(0) = sigproj[0];
2938 res0(1) = sigproj[1];
2939 res0(2) = sigproj[2];
2940 Jacobianf2(sigtrial, theta, beta, kproj, jacF2);
2942 TFad<3, STATE> thetafad(theta, 0), betafad(beta, 1), kprojfad(kproj, 2);
2944 for (
int m = 0;
m < 3;
m++) {
2945 sigtrialfad[
m] = sigtrial[
m];
2950 for (
int m = 0;
m < 3;
m++) {
2951 for (
int n = 0; n < 3; n++) {
2952 diffjac(
m, n) = jacF2(
m, n) - ddistf2[
m].fastAccessDx(n);
2953 jacF2(
m, n) = ddistf2[
m].fastAccessDx(n);
2960 jacF2.Solve_LU(&gradF2);
2961 DF2Cart(theta, beta, kproj, DF2cart);
2962 DF2cart.Multiply(gradF2, GradSigma);
2968 for (
int i = 1; i <= 10; i++) {
2970 for (
int j = 0; j < 3; j++) {
2971 diffsigma[j] = deltasigma[j] * i / 10.;
2972 nextsigma[j] = sigtrial[j] + diffsigma[j];
2973 diff(j) = diffsigma[j];
2975 jac.Multiply(diff, residguess);
2977 ProjectF2(nextsigma, kprev, sigproj, kproj);
2978 resid(0) = sigproj[0];
2979 resid(1) = sigproj[1];
2980 resid(2) = sigproj[2];
2981 xnorm[i - 1] =
Norm(diff);
2982 errnorm[i - 1] =
Norm(resid - residguess);
2992 deltasigma[1] = -4.e-6;
2993 deltasigma[2] = -4.e-6;
2997 ProjectF2(sigtrial, kprev, sigproj, kproj);
3003 Jacobianf2(sigtrial, theta, beta, kproj, jacF2);
3004 TFad<3, STATE> thetafad(theta, 0), betafad(beta, 1), kprojfad(kproj, 2);
3006 for (
int m = 0;
m < 3;
m++) {
3007 sigtrialfad[
m] = sigtrial[
m];
3012 for (
int m = 0;
m < 3;
m++) {
3013 for (
int n = 0; n < 3; n++) {
3014 diffjac(
m, n) = jacF2(
m, n) - ddistf2[
m].fastAccessDx(n);
3015 jacF2(
m, n) = ddistf2[
m].fastAccessDx(n);
3018 diffjac.
Print(
"DiffMatrix");
3023 jacF2temp.Solve_LU(&gradF2temp);
3024 GradTBK = gradF2temp;
3033 for (
int i = 0; i < 3; i++) {
3034 deltasigma[i] = rhs(i, 0);
3041 for (
int i = 1; i <= 10; i++) {
3044 for (
int j = 0; j < 3; j++) {
3045 diffsigma[j] = deltasigma[j] * i / 10.;
3046 difftbk(j) = tbk[j] * i / 10.;
3047 nextsigma[j] = sigtrial[j] + diffsigma[j];
3048 diff(j) = diffsigma[j];
3050 jac.Multiply(diff, residguess);
3064 ProjectF2(nextsigma, kprev, sigproj, kproj);
3070 xnorm[i - 1] =
Norm(diff);
3071 errnorm[i - 1] =
Norm(resid - residguess);
3072 for (
int a = 0; a < 3; a++) erros(a, i - 1) =
fabs(resid[a] - residguess[a]);
3080 STATE
E = 100, nu = 0.25,
A = 0.25,
B = 0.67,
C = 0.18,
D = 0.67,
R = 2.5,
W = 0.066,
N = 0., phi = 0, psi = 1.0;
3081 STATE
G = E / (2. * (1. + nu));
3082 STATE
K = E / (3. * (1. - 2 * nu));
3104 STATE
E = 1305, nu = 0.25,
A = 2.61,
B = 0.169,
C = 2.57,
D = 0.05069,
R = 1.5,
W = 0.0908,
N = 0., phi = 0, psi = 1.0;
3105 STATE
G = E / (2. * (1. + nu));
3106 STATE
K = E / (3. * (1. - 2 * nu));
3129 STATE
E = 22547., nu = 0.2524,
A = 689.2,
3130 B = 3.94e-4,
C = 675.2,
D = 1.47e-3,
R = 28,
W = 0.08,
N = 6., phi = 0, psi = 1.0;
3131 STATE
G = E / (2. * (1. + nu));
3132 STATE
K = E / (3. * (1. - 2 * nu));
3154 STATE
E = 29269, nu = 0.203,
A = 116.67,
3155 B = 0.0036895,
C = 111.48,
D = 0.018768,
R = 0.91969,
W = 0.006605,
N = 0., phi = 0, psi = 1.0;
3156 STATE
G = E / (2. * (1. + nu));
3157 STATE
K = E / (3. * (1. - 2 * nu));
3177 return Hash(
"TPZSandlerExtended");
void DF2Cart(STATE theta, STATE beta, STATE k, TPZFMatrix< STATE > &DF1) const
Compute the derivative of the stress (principal s;tresses) as a function of xi and beta...
void Print(std::ostream &out=std::cout)
Prints the structural information of the vector object to the output stream. This method will not p...
TPZFlopCounter atan2(const TPZFlopCounter &val1, const TPZFlopCounter &val2)
Returns the arc tangent in radians and increments the counter of the Arc Tangent. ATAN2 returns the ...
void TaylorCheckDistF1(const TPZVec< STATE > &sigmatrial, STATE xi, STATE beta, TPZVec< STATE > &xnorm, TPZVec< STATE > &errnorm) const
virtual void YieldFunction(const TPZVec< STATE > &sigma, STATE kprev, TPZVec< STATE > &yield) const override
TPZElasticResponse GetElasticResponse()
void ProjectVertex(const TPZVec< STATE > &trial_stress, STATE kprev, TPZVec< STATE > &projected_stress, STATE &kproj) const
expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ fabs
void Res2CoVertex(const TPZVec< T > &trial_stress, T beta, T k, T kprev, TPZVec< T > &residue_covertex) const
Compute the derivative of the distance function to the covertex cap function and the result of covert...
void F2Cyl(const STATE theta, const STATE beta, const STATE k, TPZVec< STATE > &f2cyl) const
bool IsZero(long double a)
Returns if the value a is close Zero as the allowable tolerance.
virtual ~TPZSandlerExtended()
Desctructor.
int Solve_LU(TPZFMatrix< TVar > *B, std::list< int64_t > &singular)
Solves the linear system using LU method .
Contains definitions to LOGPZ_DEBUG, LOGPZ_INFO, LOGPZ_WARN, LOGPZ_ERROR and LOGPZ_FATAL, and the implementation of the inline InitializePZLOG(string) function using log4cxx library or not. It must to be called out of "#ifdef LOG4CXX" scope.
Implements a vector class which allows to use external storage provided by the user. Utility.
void ProjectF2(const TPZVec< STATE > &trial_stress, STATE kprev, TPZVec< STATE > &projected_stress, STATE &kproj) const
T ResLF2IJ(const TPZVec< T > &sigtrIJ, T theta, T k, STATE kprev) const
Compute the residual of the equation which defines the update of the damage variable.
TPZElasticResponse fElasticResponse
void ApplyStressComputeElasticStrain(TPZVec< STATE > &stress, TPZVec< STATE > &strain) const
void TaylorCheckParamF1Sigtrial(const TPZVec< STATE > &sigtrial, STATE kprev, TPZVec< STATE > &xnorm, TPZVec< STATE > &errnorm) const
verifies the validity of dxi/dsigtrial and dbeta/dsigtrial
void ProjectCapCoVertex(const TPZVec< STATE > &trial_stress, STATE kprev, TPZVec< STATE > &projected_stress, STATE &kproj) const
virtual void resize(const int64_t newsize)
virtual void Print(std::ostream &out) const override
TPZSandlerExtended()
Empty constructor.
void TaylorCheckProjectSigma(const TPZVec< STATE > &trial_stress, STATE kprev, TPZVec< STATE > &xnorm, TPZVec< STATE > &errnorm) const
Compute the approximation rate for the derivative of the projected stresses respect to trial stresses...
void TaylorCheckDF2Cart(STATE theta, STATE beta, STATE k, TPZVec< STATE > &xnorm, TPZVec< STATE > &errnorm) const
void Jacobianf1(const TPZVec< STATE > &trial_stress, STATE i1, STATE beta, STATE k, TPZFMatrix< STATE > &jacobianf1) const
Compute the jacobian function of the f1 (failure) distance as a function of i1, beta and k...
void Read(TPZStream &buf, void *context) override
STATE NormalFunctionToF1(STATE &I1, STATE &k) const
void TaylorCheckDDistF1(const TPZVec< STATE > &sigmatrial, STATE xi, STATE beta, TPZVec< STATE > &xnorm, TPZVec< STATE > &errnorm) const
STATE DistF2(const TPZVec< STATE > &pt, const STATE theta, const STATE beta, const STATE k) const
Compute the distance of sigtrial to the point on the cap.
virtual void Identity()
Converts the matrix in an identity matrix.
T X(const T k) const
The function which defines the plastic surface.
void ComputeCapTangent(const TPZVec< STATE > &trial_stress, STATE kprev, TPZVec< STATE > &projected_stress, STATE &kproj, TPZFMatrix< REAL > *gradient) const
Compute the derivative of the projected stresses respect to trial stresses (tangent) over the cap...
static void CheckCoordinateTransformation(TPZVec< STATE > &cart)
void FromThetaKToSigIJ(const T &theta, const T &K, TPZVec< T > &sigIJ) const
void Write(TPZStream &buf, int withclassid) const override
Writes this object to the TPZStream buffer. Include the classid if withclassid = true.
void GradF1SigmaTrial(const TPZVec< STATE > &sigtrial, STATE xi, STATE beta, TPZFMatrix< STATE > &deriv) const
Compute the derivative of the residual with respect to sigtrial.
void SetElasticResponse(const TPZElasticResponse &ER)
void SetInitialDamage(STATE kappa_0)
void TaylorCheckProjectF2(const TPZVec< STATE > &sigtrial, STATE kprev, TPZVec< STATE > &xnorm, TPZVec< STATE > &errnorm) const
virtual int ClassId() const override
Define the class id associated with the class.
STATE NormalToF1(STATE I1, STATE I1_ref) const
Compute the normal function to the failure surface based on a reference point (I1_ref,f1(I1_ref))
void ProjectRing(const TPZVec< STATE > &trial_stress, STATE kprev, TPZVec< STATE > &projected_stress, STATE &kproj) const
void ApplyStrainComputeSigma(TPZVec< STATE > &epst, TPZVec< STATE > &epsp, STATE &kprev, TPZVec< STATE > &epspnext, TPZVec< STATE > &stressnext, STATE &knext, TPZFMatrix< REAL > *tangent=NULL) const
static void ConvergenceRate(TPZVec< STATE > &xnorm, TPZVec< STATE > &errnorm, TPZVec< STATE > &convergence)
void TaylorCheckDDistF2DSigtrial(const TPZVec< STATE > &sigmatrial, STATE theta, STATE beta, STATE k, STATE kprev, TPZVec< STATE > &xnorm, TPZVec< STATE > &errnorm) const
teste da derivada D(ResF2)/D(sigtrial)
void Firstk(STATE &epsp, STATE &k) const
Compute k as a function of epsp using Newton iterations.
void ProjectSigma(const TPZVec< STATE > &sigmatrial, STATE kprev, TPZVec< STATE > &sigmaproj, STATE &kproj, int &m_type, TPZFMatrix< REAL > *gradient=NULL) const
T ResLF2(const TPZVec< T > &pt, T theta, T beta, T k, STATE kprev) const
Compute the residual of the equation which defines the update of the damage variable.
void ApplyStrainComputeElasticStress(TPZVec< STATE > &strain, TPZVec< STATE > &stress) const
void ProjectCapVertex(const TPZVec< STATE > &trial_stress, STATE kprev, TPZVec< STATE > &projected_stress, STATE &kproj) const
int64_t size() const
Returns the number of elements of the vector.
void ProjectCoVertex(const TPZVec< STATE > &trial_stress, STATE kprev, TPZVec< STATE > &projected_stress, STATE &kproj) const
expr_ expr_ expr_ expr_ acos
virtual void Resize(const int64_t newsize, const T &object)
Resizes the vector object reallocating the necessary storage, copying the existing objects to the new...
static void SalemLimestone(TPZSandlerExtended &mat)
void GradF2SigmaTrial(const TPZVec< STATE > &sigtrial, STATE theta, STATE beta, STATE k, STATE kprev, TPZFMatrix< STATE > &deriv) const
Compute the derivative of the F2 residual with respecto do sigtrial.
void TaylorCheckDDistF1DSigtrial(const TPZVec< STATE > &sigmatrial, STATE xi, STATE beta, TPZVec< STATE > &xnorm, TPZVec< STATE > &errnorm) const
void TaylorCheckDistF2(const TPZVec< STATE > &sigmatrial, STATE theta, STATE beta, STATE k, STATE kprev, TPZVec< STATE > &xnorm, TPZVec< STATE > &errnorm) const
void ProjectSigmaDep(const TPZVec< STATE > &sigmatrial, STATE kprev, TPZVec< STATE > &sigmaproj, STATE &kproj, TPZFMatrix< STATE > &GradSigma) const
void SurfaceParamF1(TPZVec< STATE > &sigproj, STATE &xi, STATE &beta) const
void DResLF2(const TPZVec< STATE > &pt, STATE theta, STATE beta, STATE k, STATE kprev, TPZVec< STATE > &dresl) const
Compute the derivative of the equation which determines the evolution of k.
virtual void Write(const bool val)
void Jacobianf2CoVertex(const TPZVec< STATE > &trial_stress, STATE beta, STATE k, TPZFMatrix< STATE > &jacobianf2_covertex) const
Compute the jacobian function of the f2 (cap) distance as a function of beta and k.
TVar Norm(const TPZFMatrix< TVar > &A)
Returns the norm of the matrix A.
#define DebugStop()
Returns a message to user put a breakpoint in.
void Phi(TPZVec< REAL > sigma, STATE alpha, TPZVec< STATE > &phi) const
#define LOGPZ_DEBUG(A, B)
Define log for debug info.
static void ReservoirSandstone(TPZSandlerExtended &mat)
void TaylorCheckDDistF2(const TPZVec< STATE > &sigmatrial, STATE theta, STATE beta, STATE k, STATE kprev, TPZVec< STATE > &xnorm, TPZVec< STATE > &errnorm) const
int64_t Rows() const
Returns number of rows.
expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ sqrt
void JacobianVertex(const TPZVec< STATE > &trial_stress, STATE k, STATE &jacobian_vertex) const
Compute the jacobian of the distance function to the cap vertex function and the result of Vertex res...
STATE DistF1(const TPZVec< STATE > &pt, const STATE xi, const STATE beta) const
Compute the distance of sigtrial to the point on the yield surface.
STATE DResLF1(const TPZVec< STATE > &sigtrial, const TPZVec< STATE > &sigproj, const STATE k, const STATE kprev) const
Compute the derivative of the equation which determines the evolution of k.
void ProjectApex(const TPZVec< STATE > &trial_stress, STATE kprev, TPZVec< STATE > &projected_stress, STATE &kproj) const
void DDistFunc1(const TPZVec< STATE > &pt, STATE xi, STATE beta, TPZFMatrix< STATE > &ddistf1) const
Compute the derivative of the distance function to the yield surface as a function of xi and beta...
void ComputeJ2(TPZVec< STATE > stress, STATE &J2) const
void JacobianCoVertex(const TPZVec< STATE > &trial_stress, STATE beta, STATE k, TPZFMatrix< STATE > &jacobian_covertex) const
Compute the jacobian of the distance function to the cap covertex function and the result of Covertex...
void ComputeFailureTangent(const TPZVec< STATE > &trial_stress, STATE kprev, TPZVec< STATE > &projected_stress, STATE &kproj, TPZFMatrix< REAL > *gradient) const
Compute the derivative of the projected stresses respect to trial stresses (tangent) over the failure...
int Redim(const int64_t newRows, const int64_t newCols) override
Redimension a matrix and ZERO your elements.
void DF1Cart(STATE xi, STATE beta, TPZFMatrix< STATE > &DF1) const
Compute the derivative of the stress (principal s;tresses) as a function of xi and beta...
T EpsEqX(T X) const
compute the damage variable as a function of the X function
int32_t Hash(std::string str)
static void PreSMat(TPZSandlerExtended &mat)
long double gamma(unsigned int n)
Evaluate the factorial of a integer.
void Jacobianf2Vertex(const TPZVec< STATE > &trial_stress, STATE k, STATE &jacobianf2_vertex) const
Compute the jacobian function of the vertex on f2 (cap) distance as a function of k...
std::map< int, int64_t > gF2Stat
void ProjectF1(const TPZVec< STATE > &trial_stress, STATE kprev, TPZVec< STATE > &projected_stress, STATE &kproj) const
TPZFlopCounter pow(const TPZFlopCounter &orig, const TPZFlopCounter &xp)
Returns the power and increments the counter of the power.
std::map< int, int64_t > gF1Stat
int CG(Matrix &A, Vector &x, const Vector &b, Preconditioner &M, Vector *residual, int64_t &max_iter, Real &tol, const int FromCurrent)
CG solves the symmetric positive definite linear system using the Conjugate Gradient method...
void Res1(const TPZVec< T > &trial_stress, T i1, T beta, T k, T kprev, TPZVec< T > &residue_1) const
Compute the derivative of the distance function to the failure function and the result of Residue 1 (...
void TaylorCheckProjectF1(const TPZVec< STATE > &sigtrial, STATE kprev, TPZVec< STATE > &xnorm, TPZVec< STATE > &errnorm) const
REAL dist(TPZVec< T1 > &vec1, TPZVec< T1 > &vec2)
expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ log
STATE ResLF1(const TPZVec< STATE > &sigtrial, const TPZVec< STATE > &sigproj, const STATE k, const STATE kprev) const
Compute the residual of the equation which defines the update of the damage variable.
STATE DistF2IJ(const TPZVec< STATE > &sigtrialIJ, STATE theta, STATE k) const
Compute the distance considering the sigtrial is given as a funcion of I1, sqJ2.
void SetEngineeringData(REAL Eyoung, REAL Poisson)
void D2DistFunc1(const TPZVec< STATE > &pt, STATE xi, STATE beta, TPZFMatrix< STATE > &d2distf1) const
Compute the second derivative of the distance as a function of xi and beta.
STATE CPerturbation() const
std::vector< int64_t > gYield
void DDistF2IJ(TPZVec< T > &sigtrialIJ, T theta, T L, STATE Lprev, TPZVec< T > &ddistf2) const
Compute the value of the equation which determines the orthogonality of the projection.
static void MCormicRanchSand(TPZSandlerExtended &mat)
void Res2Vertex(const TPZVec< T > &trial_stress, T k, T kprev, T &residue_vertex) const
Compute the derivative of the distance function to the vertex cap function and the result of vertex R...
virtual void Multiply(const TPZFMatrix< TVar > &A, TPZFMatrix< TVar > &res, int opt=0) const
It mutiplies itself by TPZMatrix<TVar>A putting the result in res.
void Jacobianf2(const TPZVec< STATE > &trial_stress, STATE theta, STATE beta, STATE k, TPZFMatrix< STATE > &jacobianf2) const
Compute the jacobian function of the f2 (cap) distance as a function of theta, beta and k...
int64_t Cols() const
Returns number of cols.
expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ exp
virtual void Print(std::ostream &out) const
int Resize(const int64_t newRows, const int64_t wCols) override
Redimension a matrix, but maintain your elements.
STATE GetF(STATE x) const
Defines the interface for saving and reading data. Persistency.
void SetUp(STATE A, STATE B, STATE C, STATE D, STATE K, STATE G, STATE W, STATE R, STATE Phi, STATE N, STATE Psi)
void TaylorCheckDtbkDsigtrial(const TPZVec< STATE > &sigtrial, STATE kprev, TPZVec< STATE > &xnorm, TPZVec< STATE > &errnorm) const
verify D(theta,beta,k)/D(sigtrial)
Contains declaration of TPZReferredCompEl class which generates computational elements.
void Read(TPZStream &buf, void *context) override
read objects from the stream
void TaylorCheckDF1Cart(STATE xi, STATE beta, TPZVec< STATE > &xnorm, TPZVec< STATE > &errnorm) const
void ComputeI1(TPZVec< STATE > stress, STATE &I1) const
clarg::argString m("-m", "input matrix file name (text format)", "matrix.txt")
void ComputeCapVertexTangent(const TPZVec< STATE > &trial_stress, STATE kprev, TPZVec< STATE > &projected_stress, STATE &kproj, TPZFMatrix< REAL > *gradient) const
Compute the derivative of the projected stresses respect to trial stresses (tangent) over the cap...
TPZFlopCounter cos(const TPZFlopCounter &orig)
Returns the cosine in radians and increments the counter of the Cosine.
void SurfaceParamF2(const TPZVec< STATE > &sigproj, const STATE k, STATE &theta, STATE &beta) const
void Res2(const TPZVec< T > &trial_stress, T theta, T beta, T k, T kprev, TPZVec< T > &residue_2) const
Compute the derivative of the distance function to the cap function and the result of Residue 2 (Cap)...
void ComputeCapCoVertexTangent(const TPZVec< STATE > &trial_stress, STATE kprev, TPZVec< STATE > &projected_stress, STATE &kproj, TPZFMatrix< REAL > *gradient) const
Compute the derivative of the projected stresses respect to trial stresses (tangent) over the cap...
void ProjectBetaConstF2(const TPZVec< STATE > &trial_stress, STATE kprev, TPZVec< STATE > &projected_stress, STATE &kproj) const
void Write(TPZStream &buf, int withclassid) const override
void F1Cyl(STATE xi, STATE beta, TPZVec< STATE > &f1cyl) const
Compute the point on F1 in HW Cylindrical coordinates.
virtual void Read(bool &val)
T EpsEqk(const T k) const
Compute the damage variable as a function of the position of the cap k.