3 #ifndef TPZYCSANDLERDIMAGGIO_H 4 #define TPZYCSANDLERDIMAGGIO_H 22 static LoggerPtr loggerSM(Logger::getLogger(
"material.plasticity.SM"));
38 virtual int ClassId()
const override;
86 const char *
Name()
const {
87 return "TPZYCSandlerDimaggio";
90 void Print(std::ostream & out)
const override {
91 out <<
"\n" << this->
Name();
92 out <<
"\n fA = " <<
fA;
93 out <<
"\n fB = " <<
fB;
94 out <<
"\n fC = " <<
fC;
95 out <<
"\n fD = " <<
fD;
96 out <<
"\n fR = " <<
fR;
97 out <<
"\n fW = " <<
fW;
150 inline void SetUp(REAL A, REAL B, REAL C, REAL D, REAL R, REAL W) {
203 void EpspFromL(
const T &L, T &epsp)
const;
209 void DEpspDL(
const T &L, T& depspdL)
const;
215 void D2EpspDL2(
const T &L, T& d2epspdL2)
const;
219 sigmaTensor.
XX() = sigma[0];
220 sigmaTensor.
YY() = sigma[1];
221 sigmaTensor.
ZZ() = sigma[2];
222 Compute(sigmaTensor, kprev, yield, 0);
237 void SolveL(
const T & X, T & L, REAL relTol = 1.e-10)
const;
246 void ComputeDL(
const T &L,
const T &A, T &DL)
const;
260 void ComputeF(
const T & L, T & F)
const;
266 void ComputedF(
const T & L, T & dF)
const;
296 void ComputeX(
const T & A, T & X)
const;
307 REAL eps =
fW * (
exp(
fD * X) - 1);
321 REAL K = ER.
Lambda() + 2. * ER.
Mu() / 3.;
322 REAL fac1 = 3. * K*delepsp;
323 REAL fac2 = (sigtrialIJ[0]-(L + F *
fR *
cos(theta)));
325 REAL funcepsp = fac1 - fac2;
334 REAL delepsp = epsp - epspini;
337 REAL K = ER.
Lambda() + 2. * ER.
Mu() / 3.;
338 REAL fac1 = 3. * K*delepsp;
339 REAL fac2 = (sigtrialIJ[0]-(L + F *
fR *
cos(theta)));
341 REAL funcepsp = fac1 - fac2;
349 REAL DepspDL, Dtheta, DerivL;
354 Dtheta = -F *
fR *
sin(theta);
355 const REAL K = ER.
Lambda() + 2. * ER.
Mu() / 3.;
356 DerivL = 3. * K * DepspDL + (1. + DF *
fR *
cos(theta));
366 REAL X, L, DL, F, DF, Dtheta, Depsp;
374 Dtheta = -F *
fR *
sin(theta);
375 REAL K = ER.
Lambda() + 2. * ER.
Mu() / 3.;
376 Depsp = 3. * K + (DL + DF *
fR *
cos(theta));
389 REAL K = ER.
Lambda() + 2. * ER.
Mu() / 3.;
390 REAL fac1 = 3. * K * deltaL*DepspDL;
391 REAL fac2 = (sigtrialIJ[0]-(L + F *
fR *
cos(theta)));
392 REAL funcepsp = fac1 - fac2;
395 std::stringstream sout;
396 sout <<
"funcepsp " << funcepsp <<
" theta " << theta <<
" L " << L <<
" deltaL " << deltaL;
415 REAL DepspDL, D2epspDL2, Dtheta, DerivL;
421 Dtheta = -F *
fR *
sin(theta);
422 const REAL K = ER.
Lambda() + 2. * ER.
Mu() / 3.;
423 DerivL = 3. * K * DepspDL + 3. * K * deltaL * D2epspDL2 + (1. + DF *
fR *
cos(theta));
433 REAL I1 = sigtrialIJ[0];
434 REAL sqJ2 = sigtrialIJ[1];
437 const REAL K = ER.
Lambda() + 2. * ER.
Mu() / 3.;
438 const REAL G = ER.
Mu();
439 REAL y = 9. * K * (sqJ2 - F *
sin(theta));
440 REAL x = G *
fR * (I1 - (L + F *
fR *
cos(theta)));
441 REAL res = theta -
atan2(y, x);
452 REAL res =
FuncThetaL(ER, theta, L, sigtrialIJ);
460 REAL I1 = sigtrialIJ[0];
461 REAL sqJ2 = sigtrialIJ[1];
464 const REAL K = ER.
Lambda() + 2. * ER.
Mu() / 3.;
465 const REAL G = ER.
Mu();
466 REAL y = (sqJ2 - F *
sin(theta));
467 REAL x = G *
fR / (9. * K)*(I1 - (L + F *
fR *
cos(theta)));
468 REAL res = x *
sin(theta) - y *
cos(theta);
471 std::stringstream sout;
472 sout <<
"x = " << x <<
" y = " << y <<
" theta = " << theta <<
" res = " <<
res;
493 REAL I1 = sigtrialIJ[0];
494 REAL sqJ2 = sigtrialIJ[1];
497 const REAL K = ER.
Lambda() + 2. * ER.
Mu() / 3.;
498 const REAL G = ER.
Mu();
499 REAL y = (sqJ2 - F *
sin(theta));
500 REAL x = (I1 - (L + F *
fR *
cos(theta)));
501 REAL
dist = G * x * x / 2. + 9. * K * y * y / 2.;
519 REAL I1 = sigtrialIJ[0];
520 REAL sqJ2 = sigtrialIJ[1];
521 REAL X, L, DL, F, DF, Dtheta, Depsp;
529 const REAL K = ER.
Lambda() + 2. * ER.
Mu() / 3.;
530 const REAL G = ER.
Mu();
531 REAL x = G *
fR * (I1 - (L + F *
fR *
cos(theta)));
532 REAL y = 9. * K * (sqJ2 - F *
sin(theta));
533 REAL dxepsp = -G * fR * (DL + DF * fR *
cos(theta));
534 REAL dyepsp = -9. * K * DF *
sin(theta);
535 REAL dxtheta = G * fR * F * fR *
sin(theta);
536 REAL dytheta = -9. * K * F *
cos(theta);
537 REAL denom = x * x + y*y;
538 Dtheta = 1 - (-y * dxtheta + x * dytheta) / denom;
539 Depsp = -(-y * dxepsp + x * dyepsp) / denom;
548 REAL I1 = sigtrialIJ[0];
549 REAL sqJ2 = sigtrialIJ[1];
550 REAL X, L, DL, F, DF, Dtheta, Depsp;
558 const REAL K = ER.
Lambda() + 2. * ER.
Mu() / 3.;
559 const REAL G = ER.
Mu();
560 REAL x = G *
fR / (9. * K)*(I1 - (L + F *
fR *
cos(theta)));
561 REAL y = (sqJ2 - F *
sin(theta));
562 REAL dxepsp = -G *
fR / (9. * K)*(DL + DF *
fR *
cos(theta));
563 REAL dyepsp = -DF *
sin(theta);
564 REAL dxtheta = G *
fR / (9. * K) * F *
fR *
sin(theta);
565 REAL dytheta = -F *
cos(theta);
566 Dtheta = dxtheta *
sin(theta) - dytheta *
cos(theta) + x *
cos(theta) + y *
sin(theta);
567 Depsp = dxepsp *
sin(theta) - dyepsp *
cos(theta);
576 REAL I1 = sigtrialIJ[0];
577 REAL sqJ2 = sigtrialIJ[1];
578 REAL DL, F, DF, Dtheta, Depsp;
582 const REAL K = ER.
Lambda() + 2. * ER.
Mu() / 3.;
583 const REAL G = ER.
Mu();
584 REAL x = G *
fR / (9. * K)*(I1 - (L + F *
fR *
cos(theta)));
585 REAL y = (sqJ2 - F *
sin(theta));
586 REAL dxepsp = -G *
fR / (9. * K)*(DL + DF *
fR *
cos(theta));
587 REAL dyepsp = -DF *
sin(theta);
588 REAL dxtheta = G *
fR / (9. * K) * F *
fR *
sin(theta);
589 REAL dytheta = -F *
cos(theta);
590 Dtheta = dxtheta *
sin(theta) - dytheta *
cos(theta) + x *
cos(theta) + y *
sin(theta);
591 Depsp = dxepsp *
sin(theta) - dyepsp *
cos(theta);
607 sigtrialIJ[0] = L + F *
fR *
cos(theta);
608 sigtrialIJ[1] = F *
sin(theta);
616 REAL restheta, resdelepsp, disttheta;
619 disttheta =
DistTheta(ER, theta, epsp, delepsp, sigtrialIJ);
621 for (REAL thetaguess = 0.; thetaguess <= M_PI; thetaguess += M_PI / 20.) {
622 REAL distnew =
DistTheta(ER, thetaguess, epsp, delepsp, sigtrialIJ);
623 if (
fabs(distnew) <
fabs(disttheta)) {
628 REAL Xini, Lini, Fini;
633 bool secondquadrant =
false;
634 if (sigtrialIJ[0] < Lini) {
635 secondquadrant =
true;
637 if (theta < M_PI / 2 && secondquadrant) {
638 theta = M_PI / 2 + M_PI / 20.;
641 REAL arcs = sigtrialIJ[1] / Fini;
644 if (secondquadrant) {
645 theta = M_PI - theta;
648 REAL Lnew = sigtrialIJ[0] - Fini *
fR *
cos(theta);
650 delepsp = epsnew - epsp;
654 restheta =
FuncTheta2(ER, theta, epsp, delepsp, sigtrialIJ);
655 resdelepsp =
FuncEpsp(ER, theta, epsp, delepsp, sigtrialIJ);
656 REAL
error =
sqrt(restheta * restheta + resdelepsp * resdelepsp);
658 while ((
fabs(restheta) > 1.e-10 ||
fabs(resdelepsp) > 1.e-10) && count < 100) {
659 REAL errprev =
error;
663 DFuncEpsp(ER, theta, epsp, delepsp, tandelepsp);
664 DFuncTheta2(ER, theta, epsp, delepsp, sigtrialIJ, tantheta);
665 for (
int i = 0; i < 2; i++) {
666 tangent(1, i) = tandelepsp[i];
667 tangent(0, i) = tantheta[i];
669 resmat(0, 0) = restheta;
670 resmat(1, 0) = resdelepsp;
673 std::stringstream sout;
674 tangent.
Print(
"tangent matrix", sout);
675 resmat.
Print(
"residual", sout);
679 std::list<int64_t> singular;
682 if (epsp + delepsp - resmat(1, 0) < -
fW) {
683 scale = 0.9999 * (
fW + epsp + delepsp) / resmat(1, 0);
686 REAL thetaprev = theta;
687 REAL delepspprev = delepsp;
688 theta = thetaprev - resmat(0, 0);
689 delepsp = delepspprev - resmat(1, 0);
690 restheta =
FuncTheta2(ER, theta, epsp, delepsp, sigtrialIJ);
691 resdelepsp =
FuncEpsp(ER, theta, epsp, delepsp, sigtrialIJ);
692 error =
sqrt(restheta * restheta + resdelepsp * resdelepsp);
694 while (error > errprev && iline < 5) {
696 theta = thetaprev - resmat(0, 0);
697 delepsp = delepspprev - resmat(1, 0);
698 restheta =
FuncTheta2(ER, theta, epsp, delepsp, sigtrialIJ);
699 resdelepsp =
FuncEpsp(ER, theta, epsp, delepsp, sigtrialIJ);
700 error =
sqrt(restheta * restheta + resdelepsp * resdelepsp);
707 std::stringstream sout;
708 sout <<
"iteration count " << count;
715 std::stringstream sout;
716 sout <<
"sigtrialIJ input " << sigtrialIJ <<
" epsp input " << epsp <<
"\ndelepsp = " << delepsp
717 <<
" theta = " << theta;
726 REAL restheta, resdelepsp, disttheta;
736 disttheta =
DistThetaL(ER, theta, L, sigtrialIJ);
738 for (REAL thetaguess = 0.; thetaguess <= M_PI; thetaguess += M_PI / 20.) {
739 REAL distnew =
DistThetaL(ER, thetaguess, L, sigtrialIJ);
740 if (
fabs(distnew) <
fabs(disttheta)) {
745 bool secondquadrant =
false;
746 if (sigtrialIJ[0] < L) {
747 secondquadrant =
true;
749 if (theta < M_PI / 2 && secondquadrant) {
750 theta = M_PI / 2 + M_PI / 20.;
753 REAL arcs = sigtrialIJ[1] / F;
756 if (secondquadrant) {
757 theta = M_PI - theta;
760 L = sigtrialIJ[0] - F *
fR *
cos(theta);
766 REAL
error =
sqrt(restheta * restheta + resdelepsp * resdelepsp);
768 while ((
fabs(restheta) > 1.e-13 ||
fabs(resdelepsp) > 1.e-13) && count < 100) {
769 REAL errprev =
error;
775 for (
int i = 0; i < 2; i++) {
776 tangent(1, i) = tandelepsp[i];
777 tangent(0, i) = tantheta[i];
779 resmat(0, 0) = restheta;
780 resmat(1, 0) = resdelepsp;
783 std::stringstream sout;
784 tangent.
Print(
"tangent matrix", sout);
785 resmat.
Print(
"residual", sout);
789 std::list<int64_t> singular;
791 REAL thetaprev = theta;
793 theta = thetaprev - resmat(0, 0);
794 L = Lprev - resmat(1, 0);
797 error =
sqrt(restheta * restheta + resdelepsp * resdelepsp);
799 while (error > errprev && iline < 5) {
801 theta = thetaprev - resmat(0, 0);
802 L = Lprev - resmat(1, 0);
805 error =
sqrt(restheta * restheta + resdelepsp * resdelepsp);
812 std::stringstream sout;
813 sout <<
"iteration count " << count;
821 std::stringstream sout;
822 sout <<
"sigtrialIJ input " << sigtrialIJ <<
" epsp input " << epspini <<
"\ndelepsp = " << epsp - epspini
823 <<
" theta = " << theta <<
" Linitial " << Lini <<
" L " << L;
833 REAL restheta, resdeltaL, disttheta;
835 disttheta =
DistThetaL(ER, theta, L, sigtrialIJ);
837 for (REAL thetaguess = 0.; thetaguess <= M_PI; thetaguess += M_PI / 20.) {
838 REAL distnew =
DistThetaL(ER, thetaguess, L, sigtrialIJ);
839 if (
fabs(distnew) <
fabs(disttheta)) {
846 bool secondquadrant =
false;
847 if (sigtrialIJ[0] < Lini) {
848 secondquadrant =
true;
850 if (theta < M_PI / 2 && secondquadrant) {
851 theta = M_PI / 2 + M_PI / 20.;
855 if (Lini *
fB *
log(
fC) < -5. && sigtrialIJ[0] < 0.) {
856 REAL arcs = sigtrialIJ[1] / Fini;
859 if (secondquadrant) {
860 theta = M_PI - theta;
863 L = sigtrialIJ[0] - Fini *
fR *
cos(theta);
869 resdeltaL =
FuncEpspL(ER, theta, L, deltaL, sigtrialIJ);
870 REAL
error =
sqrt(restheta * restheta + resdeltaL * resdeltaL);
872 REAL diagTheta = 1., diagL = 1.;
873 REAL maxres = max(
fabs(restheta / diagTheta),
fabs(resdeltaL / diagL));
874 REAL maxresprev = maxres + 1.;
875 while ((maxres > 1.e-10 || maxres < maxresprev) && count < 150) {
877 REAL errprev =
error;
881 DFuncEpspL(ER, theta, L, deltaL, sigtrialIJ, tandeltaL);
883 for (
int i = 0; i < 2; i++) {
884 tangent(1, i) = tandeltaL[i];
885 tangent(0, i) = tantheta[i];
887 diagTheta = tangent(0, 0);
888 diagL = tangent(1, 1);
889 resmat(0, 0) = restheta;
890 resmat(1, 0) = resdeltaL;
893 std::stringstream sout;
894 tangent.
Print(
"tangent matrix", sout);
895 resmat.
Print(
"residual", sout);
899 std::list<int64_t> singular;
901 REAL thetaprev = theta;
902 REAL deltaLprev = deltaL;
903 theta = thetaprev - resmat(0, 0);
904 deltaL = deltaLprev - resmat(1, 0);
907 resdeltaL =
FuncEpspL(ER, theta, L, deltaL, sigtrialIJ);
908 error =
sqrt(restheta * restheta + resdeltaL * resdeltaL);
910 while (error > errprev && iline < 5 && maxres > 1.e-10) {
912 theta = thetaprev - resmat(0, 0);
913 deltaL = deltaLprev - resmat(1, 0);
916 resdeltaL =
FuncEpspL(ER, theta, L, deltaL, sigtrialIJ);
917 error =
sqrt(restheta * restheta + resdeltaL * resdeltaL);
920 maxres = max(
fabs(restheta / diagTheta),
fabs(resdeltaL / diagL));
922 if (count > 9 && maxres < 1.e-10) {
928 std::stringstream sout;
929 sout <<
"iteration count " << count;
936 std::stringstream sout;
937 sout <<
"sigtrialIJ input " << sigtrialIJ <<
" L input " << Lini <<
"\ndeltaL = " << deltaL
938 <<
" theta = " << theta;
1019 #ifdef LOG4CXX_PLASTICITY 1021 LoggerPtr logger(Logger::getLogger(
"plasticity.SandlerDimaggio"));
1022 std::stringstream sout;
1023 sout <<
">>> TPZYCSandlerDimaggio::Compute *** - Plastic Potential / Yield - associative";
1028 REAL L_REAL, X_REAL;
1042 res[0] =
sqrt(J2) - FI1;
1052 #ifdef LOG4CXX_PLASTICITY 1054 LoggerPtr logger(Logger::getLogger(
"plasticity.SandlerDimaggio"));
1055 std::stringstream sout;
1056 sout <<
"*** TPZYCSandlerDimaggio::ComputePlasticPotential ***";
1057 sout <<
"\nDivision by F=" <<
TPZExtractVal::val(L) <<
" at f2 - ellipsoidal hardening/softening cap";
1063 T Temp1((L - I1) / (FL * T(
fR)));
1065 T Temp2 = J2 / FL /
FL;
1067 res[1] = Temp1 + Temp2 - T(1.);
1086 #ifdef LOG4CXX_PLASTICITY 1088 LoggerPtr logger(Logger::getLogger(
"plasticity.SandlerDimaggio"));
1089 std::stringstream sout;
1090 sout <<
">>> TPZYCSandlerDimaggio::N *** - Plastification direction - associative";
1095 REAL ResTol = 1.e-6;
1097 REAL L_REAL, X_REAL;
1100 SolveL(X_REAL, L_REAL, ResTol);
1117 Temp1 =
exp(Temp1) * T(
fB *
fC);
1121 #ifdef LOG4CXX_PLASTICITY 1123 LoggerPtr logger(Logger::getLogger(
"plasticity.SandlerDimaggio"));
1124 std::stringstream sout;
1125 sout <<
"*** TPZYCSandlerDimaggio::N *** - SQRT(J2) = " <<
TPZExtractVal::val(SQRTJ2) <<
" < 1.e-6 causes error in 0-th yield function. Imposing J2 = 1.e-6 instead";
1132 Temp1 = Temp1 - I1 / SQRTJ2 / T(6.);
1133 T Temp2 = T(1.) / SQRTJ2;
1134 T Temp3 = Temp2 / T(2.);
1136 Ndir[0].XX() = Temp1 + sigma.
XX() * Temp3;
1137 Ndir[0].YY() = Temp1 + sigma.
YY() * Temp3;
1138 Ndir[0].ZZ() = Temp1 + sigma.
ZZ() * Temp3;
1142 Ndir[0].YZ() = sigma.
YZ() * Temp3;
1143 Ndir[0].XZ() = sigma.
XZ() * Temp3;
1144 Ndir[0].XY() = sigma.
XY() * Temp3;
1149 T
FL, X, L(L_REAL * 1. - ResTol);
1162 T Temp = (I1 - L) / T(
fR *
fR) - I1 / T(6.);
1163 Temp = Temp / FL2 * T(2.);
1165 #ifdef LOG4CXX_PLASTICITY 1167 LoggerPtr logger(Logger::getLogger(
"plasticity.SandlerDimaggio"));
1168 std::stringstream sout;
1169 sout <<
"*** TPZYCSandlerDimaggio::N *** X = " << X
1170 <<
"\n L = " << L <<
" L_REAL = " << L_REAL
1172 <<
"\n Temp = " << Temp;
1177 Ndir[1].XX() = Temp + sigma.
XX() / FL2;
1178 Ndir[1].YY() = Temp + sigma.
YY() / FL2;
1179 Ndir[1].ZZ() = Temp + sigma.
ZZ() / FL2;
1180 Ndir[1].YZ() = sigma.
YZ() / FL3;
1181 Ndir[1].XZ() = sigma.
XZ() / FL3;
1182 Ndir[1].XY() = sigma.
XY() / FL3;
1187 LoggerPtr logger(Logger::getLogger(
"pz.plasticity.SandlerDimaggio.main"));
1188 std::stringstream sout;
1189 sout <<
"<< TPZYCSandlerDimaggio::N *** \n sigma = \n" << sigma
1192 <<
"\nSQRTJ2 = " << SQRTJ2
1193 <<
"\nNdir = \n" << Ndir;
1214 #ifdef LOG4CXX_PLASTICITY 1216 LoggerPtr logger(Logger::getLogger(
"plasticity.SandlerDimaggio"));
1217 std::stringstream sout;
1218 sout <<
">>> TPZYCSandlerDimaggio::H *** - Hardening modulus";
1223 REAL L_REAL, X_REAL;
1232 h[0] =
exp(I1 * T(
fB)) * T(3. *
fB *
fC);
1243 h[1] = (I1 - L) / FL2 * T(6. /
fR /
fR);
1256 res = F * T(
fR) + X - L;
1266 dRes = dF * T(
fR) - T(1.);
1271 res = F * T(
fR) + X - L;
1283 L = X + FAprox * T(
fR);
1297 DL = T(1.) / (T(
fD)*(A + T(
fW))*(T(1.) + T(
fR *
fB *
fC) *
exp(T(
fB) * L)));
1317 REAL ep = -0.999999 *
fW;
1320 T dXdep = T(
fW / (ep +
fW) /
fD);
1321 X = T(
log(ep /
fW + 1.) /
fD);
1322 X = X + dXdep * (A - T(ep));
1323 #ifdef LOG4CXX_PLASTICITY 1325 LoggerPtr logger(Logger::getLogger(
"plasticity.SandlerDimaggio"));
1326 std::stringstream sout;
1327 sout <<
"*** TPZYCSandlerDimaggio::ComputeX *** ##### Changing hardening equation to adjusted linear - Excessive volumetric plastic strain - Please check aftwerwards if alpha = epsP.I1() to verify if results are consistent! ######";
1332 X = A / T(
fW) + T(1.);
1352 #ifdef LOG4CXX_PLASTICITY 1354 LoggerPtr logger(Logger::getLogger(
"plasticity.SandlerDimaggio"));
1356 std::stringstream sout;
1357 sout <<
">>> LoadState *** Tension " << state;
1365 const int nVars = 6;
1379 tangent.
Redim(1, nVars);
1381 for (i = 0; i < nVars; i++)
1382 tangent(0, i) = N_Dir[icase].fData[i];
1387 tangent.
Redim(nVars, nVars);
1389 for (i = 0; i < nVars; i++)
1390 Sigma_FAD.
fData[i].diff(i, nVars);
1391 N(Sigma_FAD, A_FAD, N_Dir_FAD, 0);
1392 for (i = 0; i < nVars; i++)
1393 for (j = 0; j < nVars; j++)
1394 tangent(i, j) = N_Dir_FAD[icase - 2].fData[i].dx(j);
1398 #ifdef LOG4CXX_PLASTICITY 1399 LoggerPtr logger(Logger::getLogger(
"plasticity.SandlerDimaggio"));
1400 std::stringstream sout;
1401 sout <<
">>> ComputeTangent *** " << tangent;
1409 const int nVars = 6;
1421 res(0, 0) = PlasticPot[icase];
1426 res.
Redim(nVars, 1);
1428 for (i = 0; i < nVars; i++)
1429 res(i, 0) = N_Dir[icase - 2].fData[i];
1433 #ifdef LOG4CXX_PLASTICITY 1434 LoggerPtr logger(Logger::getLogger(
"plasticity.SandlerDimaggio"));
1435 std::stringstream sout;
1436 sout <<
">>> Residual *** " <<
res;
1444 const int nVars = 6;
1454 sigma(
_XX_, 0) = -0.17 * multipl;
1455 sigma(
_YY_, 0) = -0.13 * multipl;
1456 sigma(
_ZZ_, 0) = -0.11 * multipl;
1457 sigma(
_XY_, 0) = -0.7 * multipl;
1458 sigma(
_XZ_, 0) = -0.5 * multipl;
1459 sigma(
_ZZ_, 0) = -0.3 * multipl;
1461 Range = sigma * (1. / 19.);
1472 #ifdef LOG4CXX_PLASTICITY 1473 LoggerPtr loggerSandlerDimaggio(Logger::getLogger(
"plasticity.SandlerDimaggio"));
1475 std::stringstream sout;
1476 sout <<
"<<< TPZYCSandlerDimaggio::TestSolveL ***";
1477 LOGPZ_INFO(loggerSandlerDimaggio, sout.str().c_str());
1481 const int oneVar = 1;
1493 REAL X, L, dF, epsVP = -.05;
1494 TFAD_ONE L_FAD, F_FAD;
1495 YCSandlerDimaggio.
ComputeX(epsVP, X);
1501 YCSandlerDimaggio.
ComputeF(L_FAD, F_FAD);
1504 #ifdef LOG4CXX_PLASTICITY 1506 std::stringstream sout;
1507 sout <<
"*** TPZYCSandlerDimaggio::TestSolveL ***";
1508 sout <<
"\nDerivative evaluated with FAD (dF/dL)FAD = " << F_FAD.dx(0);
1509 sout <<
"\nDerivative evaluated explicitly (dF/dL) = " << dF;
1510 sout <<
"\nProposed L = " << L;
1511 LOGPZ_DEBUG(loggerSandlerDimaggio, sout.str().c_str());
1515 YCSandlerDimaggio.
SolveL(X, L);
1516 #ifdef LOG4CXX_PLASTICITY 1518 std::stringstream sout;
1519 sout <<
"*** TPZYCSandlerDimaggio::TestSolveL ***";
1520 sout <<
"\nSolved L = " << L;
1521 LOGPZ_DEBUG(loggerSandlerDimaggio, sout.str().c_str());
1530 const int sixVars = 6;
1537 TFAD_SIX epsVP_FAD(epsVP);
1540 sigma.
XX() = -0.17 * multipl;
1541 sigma.
YY() = -0.13 * multipl;
1542 sigma.
ZZ() = -0.11 * multipl;
1543 sigma.
XY() = -0.7 * multipl;
1544 sigma.
YZ() = -0.5 * multipl;
1545 sigma.
XZ() = -0.3 * multipl;
1547 sigma_FAD.
XX() = sigma.
XX();
1548 sigma_FAD.
XX().diff(0, sixVars);
1550 sigma_FAD.
YY() = sigma.
YY();
1551 sigma_FAD.
YY().diff(3, sixVars);
1553 sigma_FAD.
ZZ() = sigma.
ZZ();
1554 sigma_FAD.
ZZ().diff(5, sixVars);
1556 sigma_FAD.
XY() = sigma.
XY();
1557 sigma_FAD.
XY().diff(1, sixVars);
1559 sigma_FAD.
YZ() = sigma.
YZ();
1560 sigma_FAD.
YZ().diff(4, sixVars);
1562 sigma_FAD.
XZ() = sigma.
XZ();
1563 sigma_FAD.
XZ().diff(2, sixVars);
1565 YCSandlerDimaggio.
N(sigma, epsVP, Ndir, 0);
1566 YCSandlerDimaggio.
H(sigma, epsVP, h, 0);
1567 YCSandlerDimaggio.
Compute(sigma_FAD, epsVP_FAD, PlasticPot, 0);
1569 #ifdef LOG4CXX_PLASTICITY 1571 std::stringstream sout;
1572 sout <<
"*** TPZYCSandlerDimaggio::TestSolveL ***";
1573 sout <<
"\nVerifying if H equals depsVP/dSigma = Ndir:(1 1 1 0 0 0)";
1575 for (
int i = 0; i <
NYield; i++) {
1577 sout <<
"\n" << i <<
"-th Yield Criterium";
1578 sout <<
"\nepsVP calculated from Ndir = " << Ndir[i].XX() + Ndir[i].YY() + Ndir[i].ZZ();
1579 sout <<
"\nepsVP calculated from H = " << h[i];
1580 sout <<
"\nVerifying if dPlasticPot/dSigma equals Ndir";
1581 sout <<
"\nNdir evaluated explicitly with function N():" << Ndir[i];
1582 sout <<
"\nN evaluated through FAD evaluations: dPlasticPot/dsigma:" << PlasticPot[i];
1586 LOGPZ_DEBUG(loggerSandlerDimaggio, sout.str().c_str());
1594 #ifdef LOG4CXX_PLASTICITY 1595 LoggerPtr loggerSandlerDimaggio(Logger::getLogger(
"plasticity.SandlerDimaggio"));
1597 std::stringstream sout;
1598 sout <<
">>> TPZYCSandlerDimaggio::McCormicRanchSand ***";
1599 LOGPZ_INFO(loggerSandlerDimaggio, sout.str().c_str());
1614 material.
SetUp(A, B, C, D, R, W);
1630 Compute(sigtrial, epsp, yield, 0);
1631 if (yield[0] <= 0. && yield[1] <= 0.) {
1636 if (loggerSM->isDebugEnabled()) {
1637 std::stringstream sout;
1638 sout <<
"Deformation elastic yield = " << yield;
1639 sout <<
"delgamma condition " << (delgamma[0] > 0.) <<
" " << (delgamma[1] > 0.) << std::endl;
1649 REAL I1 = sigtrial.
I1();
1650 if (yield[1] > 0.) {
1654 sigtrialIJ[1] = sqJ2;
1655 REAL epspprev = epsp;
1657 sigtrial.
Adjust(sigtrialIJ, sigproj);
1660 this->
N(sigproj, epspproj, Ndir, 1);
1662 sigPlast.
Add(sigproj, -1.);
1664 REAL scale = epsPlast.
Norm() / Ndir[1].Norm();
1665 for (
int i = 0; i < 6; i++) {
1666 REAL diff =
fabs(scale * Ndir[1][i] - epsPlast[i]);
1670 sigtrialIJ[1] = sqJ2;
1678 delgamma[1] = scale;
1680 Compute(sigproj, epspproj, yield, 0);
1682 if (loggerSM->isDebugEnabled()) {
1683 std::stringstream sout;
1684 sout <<
"After projecting the point yield = " << yield;
1685 sout <<
"\ndelgamma = " << delgamma;
1689 if (yield[0] > 0.) {
1693 if (yield[1] > 1.e-6) {
1706 T fac1 = T(
fD)*(L - FL * T(
fR));
1707 epsp = (
exp(fac1) - T(1.)) * T(
fW);
1717 T fac1 = T(
fD)*(L - FL * T(
fR));
1718 T fac2 = (T(1.) + T(
fB *
fC *
fR) *
exp(T(
fB) * L));
1719 depspdL = T(
fD *
fW) *
exp(fac1) * fac2;
1729 T fac1 = T(
fD)*(L - FL * T(
fR));
1731 T fac2 = T(1.) + BCR;
1732 T fac3 = T(
fB) * BCR + T(
fD) * fac2*fac2;
1733 d2epspdL2 = T(
fD *
fW) *
exp(fac1) * fac3;
1746 resultL = sigProj[0];
1748 REAL ddist =
DDistance(ER, resultL, sigProj);
1749 while (ddist < 0.) {
1751 ddist =
DDistance(ER, resultL, sigProj);
1753 REAL ddistnext =
fabs(ddist) + 1;
1756 while ((count < 20) && ((
fabs(ddist) > 1.e-10 &&
fabs(correct) > 1.e-14) || (
fabs(ddistnext) >
fabs(ddist)))) {
1758 REAL d2dist =
D2Distance(ER, resultL, sigProj);
1759 correct = ddist / d2dist;
1762 if (
fabs(resultL) > 1.) {
1766 ddistnext =
DDistance(ER, resultL, sigProj);
1770 sigProj[0] = resultL;
1782 for (resultL = -1.; resultL < 10.; resultL += 0.1) {
1783 residueL = 3. * K * depspdl * (resultL - L)-(sigtrialIJ[0] - sigProj[0]);
1784 table(0, count) = resultL;
1785 table(1, count) = residueL;
1790 std::ofstream fout(
"resfunc.nb");
1796 residueL = 3. * K * depspdl * (resultL - L)-(sigtrialIJ[0] - sigProj[0]);
1797 while (residueL < 0.) {
1800 residueL = 3. * K * depspdl * (resultL - L)-(sigtrialIJ[0] - sigProj[0]);
1802 while (
fabs(residueL) > 1.e-10) {
1805 STATE dres = 3. * K * depspdl + 3. * K * (resultL - L) * d2epspdl2;
1806 resultL -= residueL / dres;
1808 residueL = 3. * K * depspdl * (resultL - L)-(sigtrialIJ[0] - sigProj[0]);
1810 sigtrialIJ = sigProj;
1818 REAL I1 = sigtrialIJ[0];
1819 REAL sqj2 = sigtrialIJ[1];
1824 REAL dely = y - sqj2;
1825 REAL
dist = ER.
G() * delx * delx / 2. + dely * dely * 9. * ER.
K() / 2.;
1833 REAL I1 = sigtrialIJ[0];
1834 REAL sqj2 = sigtrialIJ[1];
1840 REAL dely = y - sqj2;
1843 REAL ddist = ER.
G() * ddelx * delx + ddely * dely * 9. * ER.
K();
1852 REAL sqj2 = sigtrialIJ[1];
1859 REAL dely = y - sqj2;
1862 REAL d2dist = ER.
G() * ddelx * ddelx + ddely * ddely * 9. * ER.
K() + d2y * dely * 9. * ER.
K();
1869 #endif //TPZYCSANDLERDIMAGGIO_H virtual int GetNYield() const override
void LInitialGuess(const T &X, T &L) const
void LoadState(TPZFMatrix< REAL > &state)
void SetForceYield(const int forceYield)
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 CheckConvergence(TConv &obj, TPZFMatrix< STATE > &state, TPZFMatrix< STATE > &range, TPZVec< REAL > &coefs)
Implements a general procedure to check whether the class TConv implements a consistente tangent matr...
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 CopyTo(TPZTensor< T1 > &target) const
void Add(const TPZTensor< T1 > &tensor, const T2 &constant)
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 ComputeX(const T &A, T &X) const
TPZManVector< T, 6 > fData
REAL FuncEpspUsingL(const TPZElasticResponse &ER, REAL theta, REAL epspini, REAL L, TPZVec< REAL > &sigtrialIJ)
void DEpspDL(const T &L, T &depspdL) const
void AlphaMultiplier(const T &A, T &multiplier) const
void SetUp(REAL A, REAL B, REAL C, REAL D, REAL R, REAL W)
REAL FuncThetaL(const TPZElasticResponse &ER, REAL theta, REAL L, TPZVec< REAL > &sigtrialIJ) const
void DFuncEpsp(const TPZElasticResponse &ER, REAL theta, REAL epsp, REAL delepsp, TPZVec< REAL > &result) const
std::underlying_type< Enumeration >::type as_integer(const Enumeration value)
void DFuncEpspUsingL(const TPZElasticResponse &ER, REAL theta, REAL L, TPZVec< REAL > &sigtrialIJ, TPZVec< REAL > &result) const
REAL FuncEpspL(const TPZElasticResponse &ER, REAL theta, REAL L, REAL deltaL, TPZVec< REAL > &sigtrialIJ)
void UpdateSigtrialIJ(const TPZElasticResponse &ER, REAL epsp, REAL theta, TPZVec< REAL > &sigtrialIJ)
void ComputeTangent(TPZFMatrix< REAL > &tangent, TPZVec< REAL > &, int icase)
void NewtonF3(const TPZElasticResponse &ER, REAL &epsp, TPZVec< REAL > &sigtrialIJ)
clarg::argBool h("-h", "help message", false)
This class implements a simple vector storage scheme for a templated class T. Utility.
void NewtonF2(const TPZElasticResponse &ER, REAL &epsp, TPZVec< REAL > &sigtrialIJ)
#define LOGPZ_WARN(A, B)
Define log for warnings.
virtual int ClassId() const override
Define the class id associated with the class.
void UpdateSigtrialIJL(const TPZElasticResponse &ER, REAL L, REAL theta, TPZVec< REAL > &sigtrialIJ)
static void McCormicRanchSand(TPZYCSandlerDimaggio &material)
TPZYCSandlerDimaggio(const TPZYCSandlerDimaggio &source)
REAL ComputeEpsp(const REAL L) const
void EpspFromL(const T &L, T &epsp) const
void ComputeF(const T &L, T &F) const
void Read(TPZStream &buf, void *context) override
read objects from the stream
void D2EpspDL2(const T &L, T &d2epspdL2) const
void DFuncTheta(const TPZElasticResponse &ER, REAL theta, REAL epsp, REAL delepsp, TPZVec< REAL > &sigtrialIJ, TPZVec< REAL > &result) const
const char * Name() const
REAL Distance(const TPZElasticResponse &ER, REAL L, TPZVec< REAL > &sigtrialIJ) const
compute the distance between the trial point and the point on the F1 curve
virtual ~TPZYCSandlerDimaggio()
#define LOGPZ_INFO(A, B)
Define log for informations.
virtual void Write(const bool val)
void ComputeStrain(const TPZTensor< T > &sigma, TPZTensor< T > &epsilon) const
Contains TPZMatrixclass which implements full matrix (using column major representation).
#define DebugStop()
Returns a message to user put a breakpoint in.
void SetYieldStatusMode(const TPZTensor< REAL > &sigma, const REAL &A)
#define LOGPZ_DEBUG(A, B)
Define log for debug info.
TPZYCSandlerDimaggio & operator=(const TPZYCSandlerDimaggio &source)
void InitialGuess(const TPZElasticResponse &ER, REAL epsp, TPZTensor< REAL > &sigtrial, REAL &epspproj, TPZVec< REAL > &delgamma, TPZTensor< REAL > &sigproj)
expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ sqrt
void DFuncTheta2L(const TPZElasticResponse &ER, REAL theta, REAL L, TPZVec< REAL > &sigtrialIJ, TPZVec< REAL > &result) const
void Adjust(TPZVec< T > &sigIJ, TPZTensor< T > &result) const
adjust the tensor to the given values of I1 and sqj2
void DFuncTheta2(const TPZElasticResponse &ER, REAL theta, REAL epsp, REAL delepsp, TPZVec< REAL > &sigtrialIJ, TPZVec< REAL > &result) const
int Redim(const int64_t newRows, const int64_t newCols) override
Redimension a matrix and ZERO your elements.
void YieldFunction(const TPZVec< STATE > &sigma, STATE kprev, TPZVec< STATE > &yield) const override
void ComputeDL(const T &L, const T &A, T &DL) const
void NewtonF2L(const TPZElasticResponse &ER, REAL &L, TPZVec< REAL > &sigtrialIJ)
REAL FuncTheta2(const TPZElasticResponse &ER, REAL theta, REAL epsp, REAL delepsp, TPZVec< REAL > &sigtrialIJ) const
REAL FuncEpsp(const TPZElasticResponse &ER, REAL theta, REAL epsp, REAL delepsp, TPZVec< REAL > &sigtrialIJ)
void Compute(const TPZTensor< T > &sigma, const T &A, TPZVec< T > &res, int checkForcedYield) const
Calculo do criterio de plastificacao.
void Print(std::ostream &out) const override
#define FL(A)
Function for dynamic cast of the material based on map A (second data)
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
static TPZTensor< REAL > gRefTension
REAL FuncTheta(const TPZElasticResponse &ER, REAL theta, REAL epsp, REAL delepsp, TPZVec< REAL > &sigtrialIJ) const
void ComputedF(const T &L, T &dF) const
void ComputeD2F(REAL L, REAL &D2F) const
void DFuncEpspL(const TPZElasticResponse &ER, REAL theta, REAL L, REAL deltaL, TPZVec< REAL > &sigtrialIJ, TPZVec< REAL > &result) const
void N(const TPZTensor< T > &sigma, const T &A, TPZVec< TPZTensor< T > > &Ndir, int checkForcedYield) const
REAL D2Distance(const TPZElasticResponse &ER, REAL L, TPZVec< REAL > &sigtrialIJ) const
compute the second derivative of the distance with respect to L
REAL DDistance(const TPZElasticResponse &ER, REAL L, TPZVec< REAL > &sigtrialIJ) const
compute the derivative of the distance with respect to L
expr_ expr_ expr_ expr_ expr_ expr_ asin
void Fill(const T ©, const int64_t from=0, const int64_t numelem=-1)
Will fill the elements of the vector with a copy object.
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.
Defines the interface for saving and reading data. Persistency.
void Write(TPZStream &buf, int withclassid) const override
Writes this object to the TPZStream buffer. Include the classid if withclassid = true.
REAL DistTheta(const TPZElasticResponse &ER, REAL theta, REAL epsp, REAL delepsp, TPZVec< REAL > &sigtrialIJ) const
void NewtonF1(const TPZElasticResponse &ER, REAL &L, TPZVec< REAL > &sigtrialIJ)
Projeto o ponto sobre a superficie F1, atualiza o L.
Contains the implementation of the CheckConvergence function.
TPZFlopCounter cos(const TPZFlopCounter &orig)
Returns the cosine in radians and increments the counter of the Cosine.
REAL DistThetaL(const TPZElasticResponse &ER, REAL theta, REAL L, TPZVec< REAL > &sigtrialIJ) const
void SolveL(const T &X, T &L, REAL relTol=1.e-10) const
void Residual(TPZFMatrix< REAL > &res, int icase)
REAL FuncTheta2L(const TPZElasticResponse &ER, REAL theta, REAL L, TPZVec< REAL > &sigtrialIJ) const
void S(TPZTensor< T > &s) const
virtual int SolveDirect(TPZFMatrix< TVar > &F, const DecomposeType dt, std::list< int64_t > &singular)
Solves the linear system using Direct methods.
Non abstract class which implements full matrices with preallocated storage with (N+1) entries...
void H(const TPZTensor< T > &sigma, const T &A, TPZVec< T > &h, int checkForcedYield) const
virtual void Read(bool &val)