13 #ifndef TPZMOHRCOULOMBNETO_H 14 #define TPZMOHRCOULOMBNETO_H 22 static LoggerPtr loggerMohrCoulomb(Logger::getLogger(
"pz.plasticity.mohrcoulombneto"));
58 void Print(std::ostream &out)
const 60 out <<
"Plastic Deformation tensor ";
62 out <<
"Acumulated plastic deformation " <<
fEpsPlasticBar << std::endl;
94 enum MPlane {ENoPlane, EElastic, EMainPlane, ERightEdge, ELeftEdge, EHydroStatic };
113 this->coesion = 9.35;
117 return fPoisson*fYoung/(1.+
fPoisson)*(1.-2.*fPoisson);
129 return fYoung/(3.*(1.-2.*
fPoisson));
134 out <<
"TPZMohrCoulombNeto\n";
146 sigmay = T(15.)+(T(2571.43))*(T(-0.0035)) + T(12904.8)*epsp;
155 ifstream file(
"curvadehardening.txt");
161 for(
int i=0;i<sz-1;i++)
169 for(
int i=0;i<sz-1;i++)
171 if(epbar >= mat(i,0) && epbar <= mat(i+1,0))
177 m = (y - y0)/(x - x0);
189 T trdeform = deform.
I1();
192 result *= (
Lambda()*trdeform);
193 result.
Add(deform,2.*
Mu());
201 for(
int i=0; i<6; i++)
211 if (loggerMohrCoulomb->isDebugEnabled()) {
212 std::stringstream sout;
213 sout <<
"Input stress tensor ";
215 sout <<
"Input tensor in decomposed form\n";
216 sigma_trial.
Print(sout);
227 for (
int i=0; i<6; i++) {
228 epstotalFAD[i].val() = epstotal[i];
229 epstotalFAD[i].fastAccessDx(i) = 1.;
238 sigmaFAD = sigmaElastFAD;
249 ReturnMapPlane<fadtype>(sigma_trial, sigma_projected, locmem);
252 ReturnMapLeftEdge<fadtype>(sigma_trial, sigma_projected, locmem);
255 ReturnMapRightEdge<fadtype>(sigma_trial, sigma_projected, locmem);
266 for (
int i=0; i<6; i++) {
267 sigma[i] = sigmaFAD[i].val();
268 for (
int j=0; j<6; j++) {
269 tangent(i,j) = sigmaFAD[i].fastAccessDx(j);
276 const REAL cosphi =
cos(fPhi);
296 ReturnMapPlane<REAL>(sigma_trial, sigma_projected, locmem);
300 ReturnMapLeftEdge<REAL>(sigma_trial, sigma_projected, locmem);
304 ReturnMapRightEdge<REAL>(sigma_trial, sigma_projected, locmem);
329 tempval=(sigma.
I1()/3.)*(1./(3.*
K()));
333 cout <<
" \n P = "<< P <<endl;
334 sigma.
S(StressDeviatoric);
336 StressDeviatoric*=1./(2.*
G());
337 cout <<
" \n S = "<< StressDeviatoric <<endl;
339 StressDeviatoric.
Add(P,1);
340 epselastic=StressDeviatoric;
342 epsplastic-=epselastic;
356 T phi = PhiPlane<T>(sigma_trial);
367 if (ReturnMapPlane<T>(sigma_trial, sigma_projected, memory)) {
377 const REAL sinpsi =
sin(fPsi);
381 ReturnMapRightEdge<T>(sigma_trial, sigma_projected, memory);
385 ReturnMapLeftEdge<T>(sigma_trial, sigma_projected, memory);
390 std::stringstream sout;
391 sout <<
"After the map to the edge, sigma_projected :\n";
392 sigma_projected.
Print(sout);
405 const REAL sinphi =
sin(fPhi);
406 const REAL cosphi =
cos(fPhi);
416 sigma_projected = sigma_trial;
419 const REAL sinphi =
sin(fPhi);
420 const REAL sinpsi =
sin(fPsi);
421 const REAL cosphi =
cos(fPhi);
422 const REAL sinphi2 = sinphi*sinphi;
423 const REAL cosphi2 = 1.-sinphi2;
424 const REAL constA = 4.*
G() *(1.+ sinphi*sinpsi/3.) + 4.*
K() * sinphi*sinpsi;
428 T phi = eigenvalues[0]-eigenvalues[2]+(eigenvalues[0]+eigenvalues[2])*sinphi-2.*sigmay*cosphi;
433 T denom = -constA- T(4.*cosphi2)*H;
435 T deriv_gamma = -phi/denom;
436 gamma += deriv_gamma;
442 phi = eigenvalues[0]-eigenvalues[2]+(eigenvalues[0]+eigenvalues[2])*sinphi-2.*sigmay*cosphi-constA*gamma;
445 }
while (
abs(phival) > tolerance);
449 eigenvalues[0] -= T(2.*
G()*(1+sinpsi/3.)+2.*
K()*sinpsi)*
gamma;
450 eigenvalues[1] += T((4.*
G()/3. -
K()*2.)*sinpsi)*
gamma;
451 eigenvalues[2] += T(2.*
G()*(1-sinpsi/3.)-2.*
K()*sinpsi)*
gamma;
453 phi = eigenvalues[0]-eigenvalues[2]+(eigenvalues[0]+eigenvalues[2])*sinphi-2.*sigmay*cosphi;
463 sigma_projected = sigma_trial;
466 const REAL sinphi =
sin(fPhi);
467 const REAL sinpsi =
sin(fPsi);
468 const REAL cosphi =
cos(fPhi);
469 const REAL sinphi2 = sinphi*sinphi;
470 const REAL cosphi2 = 1.-sinphi2;
476 sigma_bar[0] = eigenvalues[0]-eigenvalues[2]+(eigenvalues[0]+eigenvalues[2])*T(sinphi);
477 sigma_bar[1] = eigenvalues[1]-eigenvalues[2]+(eigenvalues[1]+eigenvalues[2])*T(sinphi);
481 phi[0] = sigma_bar[0] - T(2.*cosphi)*sigmay;
482 phi[1] = sigma_bar[1] - T(2.*cosphi)*sigmay;
483 ab[0] = T(4.*
G()*(1+sinphi*sinpsi/3.)+4.*
K()*sinphi*sinpsi);
484 ab[1] = T(2.*
G()*(1.-sinphi-sinpsi-sinphi*sinpsi/3.)+4.*
K()*sinphi*sinpsi);
488 d(0,0) = -ab[0]-T(4.*cosphi2)*H;
489 d(1,0) = -ab[1]-T(4.*cosphi2)*H;
490 d(0,1) = -ab[1]-T(4.*cosphi2)*H;
491 d(1,1) = -ab[0]-T(4.*cosphi2)*H;
492 T detd = d(0,0)*d(1,1)-d(0,1)*d(1,0);
493 dinverse(0,0) = d(1,1)/detd;
494 dinverse(1,0) = -d(1,0)/detd;
495 dinverse(0,1) = -d(0,1)/detd;
496 dinverse(1,1) = d(0,0)/detd;
497 gamma[0] -= (dinverse(0,0)*phi[0]+dinverse(0,1)*phi[1]);
498 gamma[1] -= (dinverse(1,0)*phi[0]+dinverse(1,1)*phi[1]);
502 phi[0] = sigma_bar[0] - ab[0]*
gamma[0] - ab[1]*
gamma[1] - T(2.*cosphi)*sigmay;
503 phi[1] = sigma_bar[1] - ab[1]*
gamma[0] - ab[0]*
gamma[0] - T(2.*cosphi)*sigmay;
506 residual=(
fabs(phival[0])+
fabs(phival[1]))/sigmay;
508 }
while (residual>tolerance);
515 eigenvalues[0] -= T(2.*
G()*(1+sinpsi/3.)+2.*
K()*sinpsi)*
gamma[0]+T((4.*
G()/3.-2.*
K())*sinpsi)*
gamma[1];
516 eigenvalues[1] += T((4.*
G()/3.-
K()*2.)*sinpsi)*gamma[0]-T(2.*
G()*(1.+sinpsi/3.)+2.*
K()*sinpsi)*gamma[1];
517 eigenvalues[2] -= T(2.*
G()*(1-sinpsi/3.)-2.*
K()*sinpsi)*(gamma[0]+gamma[1]);
525 sigma_projected = sigma_trial;
528 const REAL sinphi =
sin(fPhi);
529 const REAL sinpsi =
sin(fPsi);
530 const REAL cosphi =
cos(fPhi);
531 const REAL sinphi2 = sinphi*sinphi;
532 const REAL cosphi2 = 1.-sinphi2;
540 sigma_bar[0] = eigenvalues[0]-eigenvalues[2]+(eigenvalues[0]+eigenvalues[2])*T(sinphi);
541 sigma_bar[1] = eigenvalues[0]-eigenvalues[1]+(eigenvalues[0]+eigenvalues[1])*T(sinphi);
545 phi[0] = sigma_bar[0] - T(2.*cosphi)*sigmay;
546 phi[1] = sigma_bar[1] - T(2.*cosphi)*sigmay;
547 ab[0] = T(4.*GV*(1+sinphi*sinpsi/3.)+4.*KV*sinphi*sinpsi);
548 ab[1] = T(2.*GV*(1.+sinphi+sinpsi-sinphi*sinpsi/3.)+4.*KV*sinphi*sinpsi);
551 std::stringstream sout;
552 sout <<
"phi = " << phi << std::endl;
583 std::stringstream sout;
584 sout <<
"epsbar = " << epsbar << std::endl;
585 sout <<
"sigmay = " << sigmay << std::endl;
586 sout <<
"H = " << H << std::endl;
590 d(0,0) = -ab[0]-T(4.*cosphi2)*H;
591 d(1,0) = -ab[1]-T(4.*cosphi2)*H;
592 d(0,1) = -ab[1]-T(4.*cosphi2)*H;
593 d(1,1) = -ab[0]-T(4.*cosphi2)*H;
594 T detd = d(0,0)*d(1,1)-d(0,1)*d(1,0);
595 dinverse(0,0) = d(1,1)/detd;
596 dinverse(1,0) = -d(1,0)/detd;
597 dinverse(0,1) = -d(0,1)/detd;
598 dinverse(1,1) = d(0,0)/detd;
599 gamma[0] -= (dinverse(0,0)*phi[0]+dinverse(0,1)*phi[1]);
600 gamma[1] -= (dinverse(1,0)*phi[0]+dinverse(1,1)*phi[1]);
607 phi[0] = sigma_bar[0] - ab[0]*
gamma[0] - ab[1]*
gamma[1] - T(2.*cosphi)*sigmay;
608 phi[1] = sigma_bar[1] - ab[1]*
gamma[0] - ab[0]*
gamma[1] - T(2.*cosphi)*sigmay;
613 std::stringstream sout;
614 sout <<
"iter = " << iter <<
" phi = " << phival << std::endl;
618 residual=(
fabs(phival[0])+
fabs(phival[1]))/sigmay;
619 cout <<
"\n residula = "<< endl;
633 std::stringstream sout;
634 sout <<
"gamma = " <<
gamma << std::endl;
635 sout <<
"phival = " << phival << std::endl;
636 sout <<
"ab = " << ab << std::endl;
637 sout <<
"sigma_bar = " << sigma_bar << std::endl;
638 d.
Print(
"Jacobian",sout);
639 dinverse.
Print(
"Inverse Jacobian",sout);
640 sout <<
"epsbar = " << epsbar << std::endl;
644 eigenvalues[0] -= T(2.*GV*(1+sinpsi/3.)+2.*KV*sinpsi)*(
gamma[0]+
gamma[1]);
645 eigenvalues[1] += T((4.*GV/3.- KV*2.)*sinpsi)*
gamma[0]+T(2.*GV*(1.-sinpsi/3.)-2.*KV*sinpsi)*
gamma[1];
646 eigenvalues[2] += T(2.*GV*(1-sinpsi/3.)-2.*KV*sinpsi)*gamma[0]+T((4.*GV/3.-2.*KV)*sinpsi)*gamma[1];
661 #endif //TPZMohrCoulomb_H void CommitDeformation(TPZTensor< REAL > &epstotal, TComputeSequence &memory)
void Print(std::ostream &out=std::cout)
Prints the structural information of the vector object to the output stream. This method will not p...
bool ReturnMapRightEdge(const typename TPZTensor< T >::TPZDecomposed &sigma_trial, typename TPZTensor< T >::TPZDecomposed &sigma_projected, TComputeSequence &memory)
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)
void ComputeSigmaTangent(TPZTensor< REAL > &epstotal, TPZTensor< REAL > &sigma, TPZFNMatrix< 36, REAL > &tangent, const TComputeSequence &memory)
void Multiply(const T1 &multipl, const T2 &constant)
void Print(std::ostream &out) const
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.
const double tolerance
Tolerance value (Is zero)
TPZTensor< T >::TPZDecomposed SigmaTrial(const TPZTensor< T > &epstotal)
void PieceWise(T epbar, T &m, T &fx) const
a piecewise linear hardening function
void Print(std::ostream &out) const
TComputeSequence(const TComputeSequence ©)
TinyFad< 8, T > abs(const TinyFad< 8, T > &in)
REAL val(STATE &number)
Returns value of the variable.
void Print(std::ostream &out) const
virtual void Resize(const int64_t newsize, const T &object)
Resizes the vector object.
void PlasticityFunction(T epsp, T &sigmay, T &H) const
the hardening function and its derivative
bool ReturnMapLeftEdge(const typename TPZTensor< T >::TPZDecomposed &sigma_trial, typename TPZTensor< T >::TPZDecomposed &sigma_projected, TComputeSequence &memory)
bool ReturnMapPlane(const typename TPZTensor< T >::TPZDecomposed &sigma_trial, typename TPZTensor< T >::TPZDecomposed &sigma_projected, TComputeSequence &memory)
#define DebugStop()
Returns a message to user put a breakpoint in.
Internal structure to represent the plastic memory (plastic deformation and damage) ...
#define LOGPZ_DEBUG(A, B)
Define log for debug info.
void EigenSystem(TPZDecomposed &eigensystem) const
TComputeSequence ComputeSigma(TPZTensor< T > &epstotal, TPZTensor< T > &sigma)
REAL fEpsPlasticBar
accumulated damage
TPZTensor< T > SigmaElast(const TPZTensor< T > &deform)
T PhiPlane(typename TPZTensor< T >::TPZDecomposed &sigma) const
long double gamma(unsigned int n)
Evaluate the factorial of a integer.
void Print(std::ostream &out) const
TPZMohrCoulombNeto::TPlasticState fState
information of the plastic state of the material point
TPZTensor< REAL > fEpsPlastic
plastic deformation tensor
structure which contains the decision tree of the return map
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.
TPZManVector< T, 3 > fEigenvalues
clarg::argString m("-m", "input matrix file name (text format)", "matrix.txt")
TPlasticState(const TPlasticState ©)
TPZFlopCounter cos(const TPZFlopCounter &orig)
Returns the cosine in radians and increments the counter of the Cosine.
TPZManVector< REAL > fGamma
TComputeSequence & operator=(const TComputeSequence ©)
TPlasticState & operator=(const TPlasticState ©)
void S(TPZTensor< T > &s) const
Non abstract class which implements full matrices with preallocated storage with (N+1) entries...