3 #ifndef TPZYCSANDLERDIMAGGIOL2_H 4 #define TPZYCSANDLERDIMAGGIOL2_H 19 static LoggerPtr loggerSML2(Logger::getLogger(
"material.plasticity.SML2"));
52 const char *
Name()
const {
53 return "TPZYCSandlerDimaggioL2";
56 void Print(std::ostream & out)
const override {
57 out <<
"\n" << this->
Name();
107 REAL X, L, alpha(0.);
143 #ifdef LOG4CXX_PLASTICITY 145 LoggerPtr logger(Logger::getLogger(
"plasticity.SandlerDimaggioL"));
146 std::stringstream sout;
147 sout <<
">>> TPZYCSandlerDimaggio::Compute *** - Plastic Potential / Yield - associative";
168 res[1] =
sqrt(J2) - FI1;
170 res[0] = I1 - T(lmax);
172 if (loggerSML->isDebugEnabled()) {
173 std::stringstream sout;
179 sout <<
"Computing the distance from cap entry I1 " << I1 <<
" sqJ2 " << sqj2 <<
" lmax " << lmax <<
" F(lmax) " << FI1;
190 res[0] =
sqrt(J2) - FI1;
201 #ifdef LOG4CXX_PLASTICITY 204 LoggerPtr logger(Logger::getLogger(
"plasticity.SandlerDimaggio"));
205 std::stringstream sout;
206 sout <<
"*** TPZYCSandlerDimaggio::ComputePlasticPotential ***";
207 sout <<
"\nDivision by F=" <<
TPZExtractVal::val(L) <<
" at f2 - ellipsoidal hardening/softening cap";
213 T temp = J2 / (FL *
FL);
215 res[1] = temp - T(1.);
217 T temp2((L - I1) / (FL * T(
fR)));
219 res[1] = temp2 + temp - T(1.);
238 #ifdef LOG4CXX_PLASTICITY 240 LoggerPtr logger(Logger::getLogger(
"plasticity.SandlerDimaggioL"));
241 std::stringstream sout;
242 sout <<
">>> TPZYCSandlerDimaggio::N *** - Plastification direction - associative";
262 SQRTJ2 =
sqrt(T(1.e-6) + J2);
281 Temp1 =
exp(Temp1) * T(
fB *
fC);
285 #ifdef LOG4CXX_PLASTICITY 287 LoggerPtr logger(Logger::getLogger(
"plasticity.SandlerDimaggio"));
288 std::stringstream sout;
289 sout <<
"*** TPZYCSandlerDimaggio::N *** - SQRT(J2) = " <<
TPZExtractVal::val(SQRTJ2) <<
" < 1.e-6 causes error in 0-th yield function. Imposing J2 = 1.e-6 instead";
293 SQRTJ2 = T(1.e-6) + SQRTJ2;
296 Temp1 = Temp1 - I1 / SQRTJ2 / T(6.);
297 T Temp2 = T(1.) / SQRTJ2;
298 T Temp3 = Temp2 / T(2.);
300 Ndir[0].XX() = Temp1 + sigma.
XX() * Temp3;
301 Ndir[0].YY() = Temp1 + sigma.
YY() * Temp3;
302 Ndir[0].ZZ() = Temp1 + sigma.
ZZ() * Temp3;
306 Ndir[0].YZ() = sigma.
YZ() * Temp3;
307 Ndir[0].XZ() = sigma.
XZ() * Temp3;
308 Ndir[0].XY() = sigma.
XY() * Temp3;
310 if (loggerSML->isDebugEnabled()) {
311 std::stringstream sout;
321 Ndir[1] = Deviatoric;
341 T Temp = (I1 - L) / T(
fR *
fR) - I1 / T(6.);
342 Temp = Temp / FL2 * T(2.);
344 #ifdef LOG4CXX_PLASTICITY 346 LoggerPtr logger(Logger::getLogger(
"plasticity.SandlerDimaggio"));
347 std::stringstream sout;
348 sout <<
"*** TPZYCSandlerDimaggio::N *** X = " << X
349 <<
"\n L = " << L <<
" L_REAL = " << L_REAL
351 <<
"\n Temp = " << Temp
352 <<
"\n 3 Temp + I1/FL2 " << T(3.) * Temp + I1 / FL2;
358 Ndir[1].XX() = Temp + sigma.
XX() / FL2;
359 Ndir[1].YY() = Temp + sigma.
YY() / FL2;
360 Ndir[1].ZZ() = Temp + sigma.
ZZ() / FL2;
361 Ndir[1].YZ() = sigma.
YZ() / FL2;
362 Ndir[1].XZ() = sigma.
XZ() / FL2;
363 Ndir[1].XY() = sigma.
XY() / FL2;
367 Deviatoric *= T(1.) / (FL *
FL);
368 Ndir[1] = Deviatoric;
375 LoggerPtr logger(Logger::getLogger(
"pz.plasticity.SandlerDimaggio.main"));
376 if (0 && logger->isDebugEnabled()) {
377 std::stringstream sout;
378 sout <<
"<< TPZYCSandlerDimaggioL2::N *** \n sigma = \n" << sigma
381 <<
"\nSQRTJ2 = " << SQRTJ2
382 <<
"\nNdir = \n" << Ndir;
402 #ifdef LOG4CXX_PLASTICITY 404 LoggerPtr logger(Logger::getLogger(
"plasticity.SandlerDimaggio"));
405 std::stringstream sout;
406 sout <<
">>> TPZYCSandlerDimaggio::H *** - Hardening modulus";
425 h[0] =
exp(I1 * T(
fB)) * T(3. *
fB *
fC);
439 h[1] = (I1 - L) / FL2 * T(6. /
fR /
fR);
472 REAL I1 = sigtrial.
I1();
475 sigtrialIJ[1] = sqJ2;
476 sigtrialIJkeep = sigtrialIJ;
477 Compute(sigtrial, L, yield, 0);
478 int surfaceprojected = -1;
480 if (loggerSML->isDebugEnabled()) {
481 std::stringstream sout;
482 sout <<
"Value of fIsonCap " <<
fIsonCap;
484 sout <<
"\nI should stop";
491 if (yield[1] >= 0. && I1 < Lextern) {
492 surfaceprojected = 1;
495 sigtrial.
Adjust(sigtrialIJ, sigproj);
498 }
else if (yield[0] >= 0. && I1 >= Lextern) {
499 surfaceprojected = 0;
501 sigtrial.
Adjust(sigtrialIJ, sigproj);
505 if (sigtrialIJ[0] <= LMAX) {
507 Compute(sigproj, L, yieldCheck, 0);
508 if (
fabs(yieldCheck[0]) > 1.e-8) {
512 if (yieldCheck[1] > 0.) {
514 sigtrialIJ = sigtrialIJkeep;
516 sigtrial.
Adjust(sigtrialIJ, sigproj);
517 surfaceprojected = 2;
522 if (sigtrialIJ[0] > LMAX) {
524 sigtrialIJ[0] =
LMax();
530 sigtrialIJ[1] = sqJ2;
532 sigtrial.
Adjust(sigtrialIJ, sigproj);
537 std::stringstream sout;
538 sout <<
"Projecting on the cap after projection on F2 : sigtrialIJ " << sigtrialIJ <<
" L " << L <<
" Lproj " << Lproj;
629 this->
N(sigproj, Lproj, Ndir, 1);
631 sigPlast.
Add(sigproj, -1.);
633 sigPlastIJ[0] = sigPlast.I1();
634 sigPlastIJ[1] =
sqrt(sigPlast.J2());
637 epsplastIJ[0] = epsPlast.
I1();
638 epsplastIJ[1] =
sqrt(epsPlast.
J2());
639 REAL I1err = sigPlastIJ[0] - epsplastIJ[0]*3. * ER.
K();
640 REAL J2err = sigPlastIJ[1] - epsplastIJ[1]*2. * ER.
G();
641 if (
fabs(I1err) > 1.e-10 ||
fabs(J2err) > 1.e-10) {
648 REAL i1Ndir = Ndir[0].I1();
649 REAL sqj2Ndir =
sqrt(Ndir[1].J2());
650 REAL i1epsplast = epsPlast.
I1();
651 REAL sqj2epsplast =
sqrt(epsPlast.
J2());
653 delgamma[0] = i1epsplast / i1Ndir;
659 delgamma[1] = sqj2epsplast / sqj2Ndir;
664 if (surfaceprojected != 0 && surfaceprojected != 1 && surfaceprojected != 2) {
667 if (surfaceprojected == 0 || surfaceprojected == 1) {
668 REAL i1Ndir = Ndir[surfaceprojected].I1();
669 REAL sqj2Ndir =
sqrt(Ndir[surfaceprojected].J2());
670 REAL theta1 =
atan2(sqj2Ndir, i1Ndir);
671 REAL theta2 =
atan2(epsplastIJ[1], epsplastIJ[0]);
672 REAL difftheta = theta1 - theta2;
673 REAL sigplnorm = sigPlast.Norm();
674 if (
fabs(difftheta) > 1.e-4 && sigplnorm > 1.e-10) {
675 std::cout <<
"difftheta " << difftheta <<
" theta1 " << theta1 <<
" theta2 " << theta2 << std::endl;
679 if (surfaceprojected == 1) {
682 REAL cst = i1Ndir * (FL *
fR) / 6.;
683 REAL sst = sqj2Ndir*
FL;
684 REAL check = 1. - cst * cst - sst*sst;
685 if (
fabs(check) > 1.e-6) {
686 std::cout <<
"check = " << check <<
" cst " << cst <<
" sst " << sst << std::endl;
688 sigtrialIJ = sigtrialIJkeep;
691 theta =
atan2(sst, cst);
693 REAL xdist = sigtrialIJ[0] - Lproj;
694 REAL ydist = sigtrialIJ[1];
695 REAL theta3 =
atan2(ydist, xdist /
fR);
697 REAL thetadiff = theta - theta3;
698 if (
fabs(thetadiff) > 1.e-6) {
699 std::cout <<
" thetadiff " << thetadiff <<
" theta " << theta <<
" theta3 " << theta3 << std::endl;
702 REAL verify =
FuncTheta2L(ER, theta, Lproj, sigtrialIJkeep);
703 if (
fabs(verify) > 1.e-9) {
704 std::cout <<
"Validity of functheta " << verify << std::endl;
708 REAL scale = epsPlast.
Norm() / Ndir[surfaceprojected].Norm();
709 for (
int i = 0; i < 6; i++) {
710 REAL diff =
fabs(scale * Ndir[surfaceprojected][i] - epsPlast[i]);
712 std::cout <<
"Projection has a large error diff = " << diff <<
" scale = " << scale << std::endl;
717 delgamma[surfaceprojected] = scale;
719 STATE I1NDir0 = Ndir[0].I1();
720 STATE I1NDir1 = Ndir[1].I1();
721 if (
fabs(I1NDir1) > 1.e-6) {
724 delgamma[0] = epsplastIJ[0] / I1NDir0;
725 STATE sqj2 =
sqrt(Ndir[0].J2());
726 STATE resj2 = epsplastIJ[1] - delgamma[0] * sqj2;
727 STATE sqj2Ndir1 =
sqrt(Ndir[1].J2());
728 delgamma[1] = resj2 / sqj2Ndir1;
730 delepsp *= delgamma[0];
731 delepsp.
Add(Ndir[1], delgamma[1]);
732 for (
int i = 0; i < 6; i++) {
733 STATE diff = delepsp[i] - epsPlast[i];
734 if (
fabs(diff) > 1.e-8) {
740 Compute(sigproj, Lproj, yield, 0);
742 if (loggerSM->isDebugEnabled()) {
743 std::stringstream sout;
744 sout <<
"After projecting the point yield = " << yield;
745 sout <<
"\ndelgamma = " << delgamma;
752 if (yield[1] > 1.e-6) {
765 residueL = 3. * K * depspdl * (resultL - L)-(sigtrialIJ[0] - resultL);
766 while (
fabs(residueL) > 1.e-10) {
769 STATE dres = 3. * K * depspdl + 3. * K * (resultL - L) * d2epspdl2 + 1.;
770 resultL -= residueL / dres;
772 residueL = 3. * K * depspdl * (resultL - L)-(sigtrialIJ[0] - resultL);
776 sigtrialIJ[0] = resultL;
784 #endif //TPZYCSANDLERDIMAGGIO_H TPZYCSandlerDimaggioL & operator=(const TPZYCSandlerDimaggioL &source)
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 ...
virtual int GetNYield() const override
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 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
void DEpspDL(const T &L, T &depspdL) const
std::underlying_type< Enumeration >::type as_integer(const Enumeration value)
TPZYCSandlerDimaggioL2 & operator=(const TPZYCSandlerDimaggioL2 &source)
clarg::argBool h("-h", "help message", false)
This class implements a simple vector storage scheme for a templated class T. Utility.
#define LOGPZ_WARN(A, B)
Define log for warnings.
int ClassId() const override
Define the class id associated with the class.
void Print(std::ostream &out) const override
void ComputeF(const T &L, T &F) const
void D2EpspDL2(const T &L, T &d2epspdL2) const
const char * Name() const
void H(const TPZTensor< T > &sigma, const T &A, TPZVec< T > &h, int checkForcedYield) const
void N(const TPZTensor< T > &sigma, const T &A, TPZVec< TPZTensor< T > > &Ndir, int checkForcedYield) const
#define LOGPZ_INFO(A, B)
Define log for informations.
void ProjectBorder(const TPZElasticResponse &ER, REAL &L, TPZVec< STATE > &sigtrialIJ)
project the point on the intersection of the F1 and F2 surface
void Compute(const TPZTensor< T > &sigma, const T &A, TPZVec< T > &res, int checkForcedYield) const
Calculo do criterio de plastificacao.
void ComputeStrain(const TPZTensor< T > &sigma, TPZTensor< T > &epsilon) const
#define DebugStop()
Returns a message to user put a breakpoint in.
#define LOGPZ_DEBUG(A, B)
Define log for debug info.
expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ sqrt
void Adjust(TPZVec< T > &sigIJ, TPZTensor< T > &result) const
adjust the tensor to the given values of I1 and sqj2
void Print(std::ostream &out) const override
void NewtonF2L(const TPZElasticResponse &ER, REAL &L, TPZVec< REAL > &sigtrialIJ)
static void McCormicRanchSand(TPZYCSandlerDimaggio &material)
#define FL(A)
Function for dynamic cast of the material based on map A (second data)
virtual ~TPZYCSandlerDimaggioL2()
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
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.
void SolveL(const T &X, T &L, REAL relTol=1.e-10) const
REAL FuncTheta2L(const TPZElasticResponse &ER, REAL theta, REAL L, TPZVec< REAL > &sigtrialIJ) const
void S(TPZTensor< T > &s) const
TPZYCSandlerDimaggioL2(const TPZYCSandlerDimaggioL2 &source)
void InitialGuess(const TPZElasticResponse &ER, REAL L, TPZTensor< REAL > &sigtrial, REAL &epspproj, TPZVec< REAL > &delgamma, TPZTensor< REAL > &sigproj)