NeoPZ
TPZPlasticStepPV.cpp
Go to the documentation of this file.
1 
6 #include "TPZPlasticStepPV.h"
7 #include "TPZElasticResponse.h"
8 
9 #include "TPZSandlerExtended.h"
10 #include "TPZYCMohrCoulombPV.h"
11 #include "TPZElasticResponse.h"
12 
13 #include "pzlog.h"
14 #include "TPZYCCamClayPV.h"
15 #include "TPZYCDruckerPragerPV.h"
16 
17 //#ifdef LOG4CXX
18 //static LoggerPtr logger(Logger::getLogger("pz.material.TPZPlasticStepPV"));
19 //#endif
20 #ifdef LOG4CXX
21 static LoggerPtr logger(Logger::getLogger("plasticity.poroelastoplastic2"));
22 #endif
23 
24 #ifdef LOG4CXX
25 static LoggerPtr logger2(Logger::getLogger("plasticity.poroelastoplastic"));
26 #endif
27 
28 #define NewTangetQ
29 
30 template <class YC_t, class ER_t>
33  sigma.EigenSystem(sigma_p);
34  k = fYC.InitialDamage(sigma_p.fEigenvalues);
35 }
36 
37 template <class YC_t, class ER_t>
39  bool require_tangent_Q = (tangent != NULL);
40 
41 #ifdef PZDEBUG
42  if (require_tangent_Q) {
43  // Check for required dimensions of tangent
44  if (tangent->Rows() != 6 || tangent->Cols() != 6) {
45  std::cerr << "Unable to compute the tangent operator. Required tangent array dimensions are 6x6." << std::endl;
46  DebugStop();
47  }
48  }
49 #endif
50 
51 // TPZTensor<REAL>::TPZDecomposed sig_eigen_system_last;
52 // sigma.EigenSystem(sig_eigen_system_last);
53 
54  // Initialization and spectral decomposition for the elastic trial stress state
55  TPZTensor<REAL> eps_tr = epsTotal - fN.m_eps_p;
56  TPZTensor<REAL> sig_tr;
57  fER.ComputeStress(eps_tr, sig_tr);
58  TPZTensor<REAL>::TPZDecomposed sig_eigen_system;
59  sig_tr.EigenSystem(sig_eigen_system);
60 
62 // TrialStressCorrection(fN.fAlpha,sig_eigen_system_last.fEigenvalues,sig_eigen_system.fEigenvalues);
63 
64  int m_type = 0;
65  STATE nextalpha = 0;
66  TPZManVector<REAL, 3> sig_projected(3, 0.);
67 
68  // ReturMap in the principal values
69  if (require_tangent_Q) {
70  TPZTensor<REAL>::TPZDecomposed eps_eigen_system;
71  eps_tr.EigenSystem(eps_eigen_system);
72 
73  TPZFMatrix<REAL> gradient(3, 3, 0.);
74  fYC.ProjectSigma(sig_eigen_system.fEigenvalues, fN.m_hardening, sig_projected, nextalpha, m_type, &gradient);
75  TangentOperator(gradient, eps_eigen_system, sig_eigen_system, *tangent);
76  } else{
77  fYC.ProjectSigma(sig_eigen_system.fEigenvalues, fN.m_hardening, sig_projected, nextalpha, m_type);
78  }
79 
80  fN.m_hardening = nextalpha;
81  fN.m_m_type = m_type;
82 
83 #ifdef LOG4CXX_KEEP
84  if(logger->isDebugEnabled())
85  {
86  std::stringstream sout;
87  sout << "Sig Trial " << sigtrvec << "\nSig Project " << sigprvec << std::endl;
88  LOGPZ_DEBUG(logger, sout.str())
89  }
90 #endif
91 
92  // Reconstruction of sigmaprTensor
93  sig_eigen_system.fEigenvalues = sig_projected; // Under the assumption of isotropic material eigen vectors remain unaltered
94  sigma = TPZTensor<REAL>(sig_eigen_system);
95 
96  TPZTensor<REAL> eps_e_Np1;
97  fER.ComputeStrain(sigma, eps_e_Np1);
98  fN.m_eps_t = epsTotal;
99  fN.m_eps_p = epsTotal - eps_e_Np1;
100 }
101 
102 template <class YC_t, class ER_t>
104 {
105 
106  bool require_tangent_Q = (tangent != NULL);
107 
108 #ifdef PZDEBUG
109  if (require_tangent_Q) {
110  // Check for required dimensions of tangent
111  if (tangent->Rows() != 6 || tangent->Cols() != 6) {
112  std::cerr << "Unable to compute the tangent operator. Required tangent array dimensions are 6x6." << std::endl;
113  DebugStop();
114  }
115  }
116 #endif
117 
118  TPZTensor<REAL>::TPZDecomposed sig_eigen_system;
119  TPZTensor<REAL> sig_tr;
120 
121  // Initialization and spectral decomposition for the elastic trial stress state
122  TPZTensor<REAL> eps_tr, eps_p_N, eps_e_Np1;
123  eps_p_N = fN.m_eps_p;
124  eps_tr = epsTotal;
125  eps_tr -= eps_p_N;
126  fER.ComputeStress(eps_tr, sig_tr);
127  sig_tr.EigenSystem(sig_eigen_system);
128 
129 
130  int m_type = 0;
131  STATE nextalpha = 0;
132  TPZManVector<REAL, 3> sig_projected(3, 0.);
133 
134  // ReturMap in the principal values
135  if (require_tangent_Q) {
136  // Required data when tangent is needed
137  TPZTensor<REAL>::TPZDecomposed eps_eigen_system;
138  TPZFMatrix<REAL> gradient(3, 3, 0.);
139 
140  eps_tr.EigenSystem(eps_eigen_system);
141 
142  fYC.ProjectSigma(sig_eigen_system.fEigenvalues, fN.m_hardening, sig_projected, nextalpha, m_type, &gradient);
143  TangentOperator(gradient, eps_eigen_system, sig_eigen_system, *tangent);
144  }
145  else{
146  fYC.ProjectSigma(sig_eigen_system.fEigenvalues, fN.m_hardening, sig_projected, nextalpha, m_type);
147  }
148 
149 
150  fN.m_hardening = nextalpha;
151  fN.m_m_type = m_type;
152 
153 #ifdef LOG4CXX_KEEP
154  if(logger->isDebugEnabled())
155  {
156  std::stringstream sout;
157  sout << "Sig Trial " << sigtrvec << "\nSig Project " << sigprvec << std::endl;
158  LOGPZ_DEBUG(logger, sout.str())
159  }
160 #endif
161 
162  // Reconstruction of sigmaprTensor
163  sig_eigen_system.fEigenvalues = sig_projected; // Under the assumption of isotropic material eigen vectors remain unaltered
164 // sigma = TPZTensor<REAL>(sig_eigen_system);
165 
166  fER.ComputeStrain(sigma, eps_e_Np1);
167  fN.m_eps_t = epsTotal;
168  eps_p_N = epsTotal;
169  eps_p_N -= eps_e_Np1; // plastic strain update
170  fN.m_eps_p = eps_p_N;
171 }
172 
173 template <class YC_t, class ER_t>
175 
176  TPZVec<STATE> sig_vec(3), sig(3);
177  sig_vec[0] = sigma_tr[0] - sigma[0];
178  sig_vec[1] = sigma_tr[1] - sigma[1];
179  sig_vec[2] = sigma_tr[2] - sigma[2];
180 
181  TPZVec<STATE> phi_n,phi;
182  fYC.Phi(sigma,kappa,phi);
183 
184 // bool positive_state_Q = IsZero(phi[0]) || phi[0] > 0.0;
185 // if (positive_state_Q) {
186 // sigma_tr = sigma;
187 // return;
188 // }
189 
190  int n_steps = 10;
191  REAL d_alpha = 0.1;
192  REAL alpha = 0.0;
193  bool plastic_state_Q;
194  for (int i = 1; i <= n_steps; i++) {
195  alpha = REAL(i*d_alpha);
196 
197  sig[0] = alpha*sig_vec[0] +sigma[0];
198  sig[1] = alpha*sig_vec[1] +sigma[1];
199  sig[2] = alpha*sig_vec[2] +sigma[2];
200  fYC.Phi(sig,kappa,phi_n);
201 
202  plastic_state_Q = IsZero(phi_n[0]) || phi_n[0] > 0.0;
203  if (plastic_state_Q) {
204  sigma_tr = sig;
205  return;
206  }
207  }
208 
209 }
210 
211 template <class YC_t, class ER_t>
213 
214  TPZTensor<REAL>::TPZDecomposed sig_eigen_system, eps_eigen_system;
215  TPZTensor<REAL> sigtr;
216 
217  TPZTensor<REAL> epsTr, epsPN, epsElaNp1;
218  epsPN = fN.m_eps_p;
219  epsTr = epsTotal;
220  epsTr -= epsPN; // Porque soh tem implementado o operator -=
221 
222  // Compute and Decomposition of SigTrial
223  fER.ComputeStress(epsTr, sigtr); // sigma = lambda Tr(E)I + 2 mu E
224  epsTr.EigenSystem(eps_eigen_system);
225  epsTr.ComputeEigenvectors(eps_eigen_system);
226  sigtr.EigenSystem(sig_eigen_system);
227  sigtr.ComputeEigenvectors(sig_eigen_system);
228 
229  TPZManVector<REAL, 3> sigtrvec(sig_eigen_system.fEigenvalues), sigprvec(3, 0.);
230 
231 #ifdef LOG4CXX
232  if (logger->isDebugEnabled()) {
233  std::stringstream sout;
234  sig_eigen_system.Print(sout);
235  LOGPZ_DEBUG(logger, sout.str())
236  }
237  STATE printPlastic = fN.VolHardening();
238 #endif
239 
240  // ReturnMap in the principal values
241  STATE nextalpha = 0;
242  TPZFNMatrix<9> GradSigma(3, 3, 0.);
243  fYC.ProjectSigmaDep(sigtrvec, fN.m_hardening, sigprvec, nextalpha, GradSigma);
244  fN.m_hardening = nextalpha;
245 
246 #ifdef LOG4CXX
247  if (logger->isDebugEnabled()) {
248  std::stringstream sout;
249  sout << "Sig Trial " << sigtrvec << "\nSig Project " << sigprvec << std::endl;
250  GradSigma.Print("GradSigma", sout, EMathematicaInput);
251  LOGPZ_DEBUG(logger, sout.str())
252  }
253 #endif
254 
255  // Reconstruction of sigmaprTensor
256  sig_eigen_system.fEigenvalues = sigprvec; // updating the projected values used inside TangentOperator method.
257  sigma = TPZTensor<REAL>(sig_eigen_system);
258  TangentOperator(GradSigma, eps_eigen_system, sig_eigen_system, Dep);
259 
260  fER.ComputeStrain(sigma, epsElaNp1);
261  fN.m_eps_t = epsTotal;
262  epsPN = epsTotal;
263  epsPN -= epsElaNp1; // Transforma epsPN em epsPNp1
264  fN.m_eps_p = epsPN;
265 
266 
267 #ifdef LOG4CXX
268  if (logger2->isDebugEnabled()) {
269  if (fabs(printPlastic - fN.m_hardening) > 1.e-4) {
270  std::stringstream sout;
271  TPZVec<STATE> phi;
272  TPZTensor<STATE> epsElastic(fN.m_eps_t);
273  epsElastic -= fN.m_eps_p;
274  Phi(epsElastic, phi);
275  sout << " \n phi = [";
276  for (int i = 0; i < phi.size(); i++) {
277  sout << phi[i] << " ";
278  }
279 
280  sout << " ] " << endl;
281 
282  sout << " \n eigenvalues Sigma = [";
283  for (int i = 0; i < 3; i++) {
284  sout << sig_eigen_system.fEigenvalues[i] << " ";
285  }
286 
287  sout << " ] " << endl;
288 
289 
290 
291  LOGPZ_DEBUG(logger2, sout.str())
292  }
293  }
294 #endif
295 }
296 
297 template <class YC_t, class ER_t>
299 
300 
301  //Montando a matriz tangente
302  unsigned int kival[] = {0, 0, 0, 1, 1, 2};
303  unsigned int kjval[] = {0, 1, 2, 1, 2, 2};
304  REAL G = fER.G();
305  REAL lambda = fER.Lambda();
306 
307  // Coluna da matriz tangente
308  for (unsigned int k = 0; k < 6; ++k) {
309  const unsigned int ki = kival[k];
310  const unsigned int kj = kjval[k];
311  for (unsigned int i = 0; i < 3; ++i) {
312  for (unsigned int j = 0; j < 3; ++j) {
313  REAL temp = 2 * G * eps_eigen_system.fEigenvectors[j][kj] * eps_eigen_system.fEigenvectors[j][ki];
314  if (ki == kj) {
315  temp += lambda;
316  } else {
317  temp *= 2.;
318  }
319  for (int l = 0; l < 6; ++l) {
320  const unsigned int li = kival[l];
321  const unsigned int lj = kjval[l];
322  Tangent(l, k) += temp * gradient(i, j) * eps_eigen_system.fEigenvectors[i][li] * eps_eigen_system.fEigenvectors[i][lj];
323  }
324  }
325  }
326  }
327 
328  REAL deigensig = 0., deigeneps = 0.;
329  TPZFNMatrix<9, REAL> tempMat(3, 3, 0.);
330  TPZFNMatrix<9, REAL> temp_mat(3, 3, 0.);
331 // TPZFNMatrix<9> ColCorr(3, 3, 0.);
332  TPZFNMatrix<6> ColCorrV(6, 1, 0.);
333 
334  // Correction of the eigenvectors variation
335  for (unsigned int i = 0; i < 2; ++i) {
336  for (unsigned int j = i + 1; j < 3; ++j) {
337  deigeneps = eps_eigen_system.fEigenvalues[i] - eps_eigen_system.fEigenvalues[j];
338  deigensig = sig_eigen_system.fEigenvalues[i] - sig_eigen_system.fEigenvalues[j];
339 
340  REAL factor = 0.;
341  if (!IsZero(deigeneps)) {
342  factor = deigensig / deigeneps;
343  } else {
344  factor = fER.G() * (gradient(i, i) - gradient(i, j) - gradient(j, i) + gradient(j, j)); // expression C.20
345  }
346 
347  ProdT(eps_eigen_system.fEigenvectors[i], eps_eigen_system.fEigenvectors[j],temp_mat);
348  for (unsigned int it = 0; it < 3; ++it) {
349  for (unsigned int jt = 0; jt < 3; ++jt) {
350  tempMat(it,jt) += temp_mat(it,jt);
351  }
352  }
353 
354  ProdT(eps_eigen_system.fEigenvectors[j], eps_eigen_system.fEigenvectors[i],temp_mat);
355  for (unsigned int it = 0; it < 3; ++it) {
356  for (unsigned int jt = 0; jt < 3; ++jt) {
357  tempMat(it,jt) += temp_mat(it,jt);
358  }
359  }
360 
361  // expression C.14
362  for (unsigned int k = 0; k < 6; ++k) {
363  const unsigned int ki = kival[k];
364  const unsigned int kj = kjval[k];
365  if (ki == kj) {
366  temp_mat = (eps_eigen_system.fEigenvectors[j][ki] * eps_eigen_system.fEigenvectors[i][kj]) * factor * tempMat;
367  } else {
368  temp_mat = (eps_eigen_system.fEigenvectors[j][ki] * eps_eigen_system.fEigenvectors[i][kj] + eps_eigen_system.fEigenvectors[j][kj] * eps_eigen_system.fEigenvectors[i][ki]) * factor * tempMat;
369  }
370  ColCorrV = FromMatToVoight(temp_mat);
371  for (int l = 0; l < 6; l++) {
372  Tangent(l, k) += ColCorrV(l, 0);
373  }
374  }
375  } // j
376  } // i
377 
378 }
379 
380 template <class YC_t, class ER_t>
382  TPZTensor<REAL> eps1, eps2, SigmaTemp, Sigma1, Sigma2;
383  TPZFNMatrix <36> dSigDe(6, 6, 0.);
384  TPZStack<REAL> coef;
385 
386  fN.m_eps_p.Scale(0.);
387  fN.m_eps_t.Scale(0.);
388  fN.m_hardening = kprev;
389  this->ApplyStrainComputeDep(EpsIni, SigmaTemp, dSigDe);
390 #ifdef LOG4CXX
391  {
392  std::stringstream sout;
393  sout << "EpsIni " << EpsIni << "\nSigmaTemp " << SigmaTemp << "\ndSidDe " << dSigDe << std::endl;
394  LOGPZ_DEBUG(logger, sout.str())
395  }
396 #endif
397  fN.m_eps_p.Scale(0.);
398  fN.m_eps_t.Scale(0.);
399  fN.m_hardening = kprev;
400 
401  REAL scale = 1.;
402  REAL alphatable[] = {0.1, 0.2, 0.3, 0.4, 0.5, 0.6};
403  for (int i = 0; i < 6; i++) {
404  alphatable[i] *= scale;
405  }
406  for (int ia = 0; ia < 5; ia++) {
407  REAL alpha1 = alphatable[0];
408  REAL alpha2 = alphatable[ia + 1];
409  eps1.Scale(0.);
410  eps2.Scale(0.);
411  eps1 = EpsIni;
412  eps2 = EpsIni;
413  eps1.Add(deps, alpha1);
414  eps2.Add(deps, alpha2);
415 
416  fN.m_eps_t = EpsIni;
417  this->ApplyStrainComputeSigma(eps1, Sigma1);
418  fN.m_eps_p.Scale(0.);
419  fN.m_eps_t.Scale(0.);
420  fN.m_hardening = kprev;
421 
422  fN.m_eps_t = EpsIni;
423  this->ApplyStrainComputeSigma(eps2, Sigma2);
424  fN.m_eps_p.Scale(0.);
425  fN.m_eps_t.Scale(0.);
426  fN.m_hardening = kprev;
427 
428  TPZFNMatrix <6> deps1(6, 1, 0.), deps2(6, 1, 0.);
429  TPZFNMatrix <9> depsMat(3, 3, 0.);
430  depsMat = deps;
431  deps1 = FromMatToVoight(depsMat);
432  deps2 = FromMatToVoight(depsMat);
433 
434  TPZFNMatrix <6> tanmult1(6, 1, 0.), tanmult2(6, 1, 0.);
435  dSigDe.Multiply(deps1, tanmult1);
436  dSigDe.Multiply(deps2, tanmult2);
437 
438  for (int i = 0; i < 6; i++) {
439  tanmult1(i, 0) *= alpha1;
440  tanmult2(i, 0) *= alpha2;
441  }
442 
443  TPZFNMatrix <9> SigMatTemp33(3, 3, 0.);
444  TPZFNMatrix <6> sigprMat(6, 1, 0.), sigpr1Mat(6, 1, 0.), sigpr2Mat(6, 1, 0.);
445  SigMatTemp33 = SigmaTemp;
446  sigprMat = FromMatToVoight(SigMatTemp33);
447  SigMatTemp33 = Sigma1;
448  sigpr1Mat = FromMatToVoight(SigMatTemp33);
449  SigMatTemp33 = Sigma2;
450  sigpr2Mat = FromMatToVoight(SigMatTemp33);
451 
452  TPZFNMatrix<6> error1(6, 1, 0.), error2(6, 1, 0.);
453 #ifdef LOG4CXX
454  if (logger->isDebugEnabled()) {
455  std::stringstream sout;
456  sigprMat.Print("sigprMat", sout);
457  sigpr1Mat.Print("sigpr1Mat", sout);
458  tanmult1.Print("tanmult1", sout);
459  sigpr2Mat.Print("sigpr2Mat", sout);
460  tanmult2.Print("tanmult2", sout);
461  LOGPZ_DEBUG(logger, sout.str())
462  }
463 #endif
464  for (int i = 0; i < 6; i++) {
465  error1(i, 0) = sigpr1Mat(i, 0) - sigprMat(i, 0) - tanmult1(i, 0);
466  error2(i, 0) = sigpr2Mat(i, 0) - sigprMat(i, 0) - tanmult2(i, 0);
467  }
468 #ifdef LOG4CXX
469  if (logger->isDebugEnabled()) {
470  std::stringstream sout;
471  error1.Print("error1:", sout);
472  error2.Print("error2:", sout);
473  LOGPZ_DEBUG(logger, sout.str())
474  }
475 #endif
476  REAL n;
477  REAL norm1, norm2;
478  norm1 = NormVecOfMat(error1);
479  norm2 = NormVecOfMat(error2);
480  n = (log(norm1) - log(norm2)) / (log(alpha1) - log(alpha2));
481  coef.push_back(n);
482  }
483  conv = coef;
484  std::cout << "coef = " << coef << std::endl;
485 }
486 
487 template <class YC_t, class ER_t >
489 {
490  REAL norm1, norm2, n;
491  norm1 = NormVecOfMat(error1Mat);
492  norm2 = NormVecOfMat(error2Mat);
493  n = log(norm1 / norm2) / log(alpha1 / alpha2);
494  return n;
495 }
496 
498 {
499  REAL norm = 0.;
500  for (int i = 0; i < mat.Rows(); i++) {
501  norm += mat(i, 0) * mat(i, 0);
502  }
503  norm = sqrt(norm);
504  return norm;
505 }
506 
508 {
509  REAL dot = 0.;
510  for (int i = 0; i < m1.Rows(); i++) {
511  dot += m1(i, 0) * m2(i, 0);
512  }
513  return dot;
514 }
515 
517  TPZFMatrix<REAL> mat(3, 3, 0.);
518  for (int i = 0; i < 3; i++) {
519  for (int j = 0; j < 3; j++) {
520  mat(i, j) = v1[i] * v2[j];
521  }
522  }
523  return mat;
524 }
525 
527  for (int i = 0; i < 3; i++) {
528  for (int j = 0; j < 3; j++) {
529  mat(i, j) = v1[i] * v2[j];
530  }
531  }
532 }
533 
535 {
536  TPZFNMatrix <6> voi(6, 1, 0.);
537  int k = 0;
538  for (int i = 0; i < 3; i++) {
539  for (int j = i; j < 3; j++) {
540  voi(k++, 0) = mat(i, j);
541  }
542  }
543  return voi;
544 }
545 
546 template <class YC_t, class ER_t>
548 {
549 
550  std::cout << " \n this method is not implemented in PlasticStepPV. ";
551  DebugStop();
552 
553 }
554 
555 template <class YC_t, class ER_t>
557  //@TODO: Refactor this code
558  TPZPlasticState<STATE> prevstate = GetState();
559  epsTotal = prevstate.m_eps_p;
560  TPZTensor<STATE> GuessStress, Diff, Diff2;
561  TPZFNMatrix<36, STATE> Dep(6, 6, 0.0);
562  TPZFNMatrix<6, STATE> DiffFN(6, 1);
563 
564  ApplyStrainComputeSigma(epsTotal, GuessStress, &Dep);
565 #ifdef LOG4CXX
566  if (logger->isDebugEnabled()) {
567  std::stringstream sout;
568  Dep.Print("Dep = ", sout, EMathematicaInput);
569  LOGPZ_DEBUG(logger, sout.str())
570  }
571 #endif
572  Diff = GivenStress - GuessStress;
573 
574  STATE norm = Norm(Diff), normprev;
575  STATE tol = 1.e-7;
576  int counter = 0;
577 
578  while (norm>tol && counter<30) {
579  CopyFromTensorToFMatrix(Diff, DiffFN);
580  Dep.Solve_LU(&DiffFN);
581  CopyFromFMatrixToTensor(DiffFN, Diff);
582  TPZTensor<STATE> epsprev(epsTotal);
583  normprev = norm;
584  STATE scale = 1.;
585  int counter2 = 0;
586  do {
587  epsTotal = epsprev;
588  epsTotal.Add(Diff, scale);
589 
590  ApplyStrainComputeSigma(epsTotal, GuessStress, &Dep);
591 #ifdef LOG4CXX
592  if (logger->isDebugEnabled()) {
593  std::stringstream sout;
594  Dep.Print("Dep = ", sout, EMathematicaInput);
595  LOGPZ_DEBUG(logger, sout.str())
596  }
597 #endif
598 
599  fN = prevstate;
600  Diff2 = GivenStress-GuessStress;
601  CopyFromTensorToFMatrix(Diff2, DiffFN);
602  Dep.Solve_LU(&DiffFN);
603  norm = Norm(Diff2);
604  //scale*=0.5;
605  counter2++;
606  } while (norm >= normprev && counter2 < 30);
607  Diff = Diff2;
608  counter++;
609  }
610  ApplyStrainComputeSigma(epsTotal, GuessStress, &Dep);
611 }
612 
613 template <class YC_t, class ER_t >
615 {
616  return fN;
617 }
618 
619 template <class YC_t, class ER_t>
621 {
622  TPZTensor<STATE> sigma;
623  fER.ComputeStress(eps, sigma);
625  sigma.EigenSystem(DecSig);
626  TPZVec<STATE> sigvec(3);
627  sigvec[0] = DecSig.fEigenvalues[0];
628  sigvec[1] = DecSig.fEigenvalues[1];
629  sigvec[2] = DecSig.fEigenvalues[2];
630  fYC.Phi(sigvec, fN.VolHardening(), phi);
631 }
632 
633 template <class YC_t, class ER_t>
635 {
636  fN = state;
637 }
638 
639 template<class YC_t, class ER_t>
640 void TPZPlasticStepPV<YC_t, ER_t>::Write(TPZStream& buf, int withclassid) const {
641  fYC.Write(buf, withclassid);
642  fER.Write(buf, withclassid);
643  buf.Write(&fResTol);
644  buf.Write(&fMaxNewton);
645  fN.Write(buf, withclassid);
646 }
647 
648 template<class YC_t, class ER_t>
650  fYC.Read(buf, context);
651  fER.Read(buf, context);
652  buf.Read(&fResTol);
653  buf.Read(&fMaxNewton);
654  fN.Read(buf, context);
655 }
656 
658 //YC_t fYC;
659 
661 //ER_t fER;
662 
664 //REAL fResTol;
665 
667 //int fMaxNewton; // COLOCAR = 30 (sugestao do erick!)
668 
669 
670 
671 
673 //TPZPlasticState<STATE> fN;
674 
675 template <class YC_t, class ER_t>
677 {
678  FNM.Resize(6, 1);
679  copy.XX() = FNM(0, 0);
680  copy.XY() = FNM(1, 0);
681  copy.XZ() = FNM(2, 0);
682  copy.YY() = FNM(3, 0);
683  copy.YZ() = FNM(4, 0);
684  copy.ZZ() = FNM(5, 0);
685 }
686 
687 template <class YC_t, class ER_t>
689 {
690 
691  copy(0, 0) = tensor.XX();
692  copy(1, 0) = tensor.XY();
693  copy(2, 0) = tensor.XZ();
694  copy(3, 0) = tensor.YY();
695  copy(4, 0) = tensor.YZ();
696  copy(5, 0) = tensor.ZZ();
697 }
698 
699 template <class YC_t, class ER_t>
701 {
702  fER = ER;
703  fYC.SetElasticResponse(ER);
704 }
705 
clarg::argString m2("-m2", "argument matrix file name (text format)", "matrix2.txt")
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
Definition: tfadfunc.h:140
virtual void ApplyStrainComputeDep(const TPZTensor< REAL > &epsTotal, TPZTensor< REAL > &sigma, TPZFMatrix< REAL > &Dep) override
void Add(const TPZTensor< T1 > &tensor, const T2 &constant)
Definition: TPZTensor.h:757
virtual void ApplyStrain(const TPZTensor< REAL > &epsTotal) override
bool IsZero(long double a)
Returns if the value a is close Zero as the allowable tolerance.
Definition: pzreal.h:668
int Solve_LU(TPZFMatrix< TVar > *B, std::list< int64_t > &singular)
Solves the linear system using LU method .
Definition: pzmatrix.h:900
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.
void TaylorCheck(TPZTensor< REAL > &EpsIni, TPZTensor< REAL > &deps, REAL kprev, TPZVec< REAL > &conv)
void ComputeEigenvectors(TPZDecomposed &eigensystem) const
Definition: TPZTensor.h:1321
T & YY() const
Definition: TPZTensor.h:578
virtual void Phi(const TPZTensor< REAL > &epsTotal, TPZVec< REAL > &phi) const override
Return the value of the yield functions for the given strain.
TPZFNMatrix< 6 > FromMatToVoight(TPZFNMatrix< 9 > mat)
REAL ComputeNFromTaylorCheck(REAL alpha1, REAL alpha2, TPZFMatrix< REAL > &error1Mat, TPZFMatrix< REAL > &error2Mat)
virtual void SetElasticResponse(TPZElasticResponse &ER) override
int64_t size() const
Returns the number of elements of the vector.
Definition: pzvec.h:196
void Read(TPZStream &buf, void *context) override
read objects from the stream
T & YZ() const
Definition: TPZTensor.h:582
static const double tol
Definition: pzgeoprism.cpp:23
void Write(TPZStream &buf, int withclassid) const override
Writes this object to the TPZStream buffer. Include the classid if withclassid = true.
virtual void SetState(const TPZPlasticState< REAL > &state) override
Update the damage values.
virtual void Write(const bool val)
Definition: TPZStream.cpp:8
TVar Norm(const TPZFMatrix< TVar > &A)
Returns the norm of the matrix A.
#define DebugStop()
Returns a message to user put a breakpoint in.
Definition: pzerror.h:20
virtual void InitialDamage(const TPZTensor< REAL > &sigma, REAL &k)
#define LOGPZ_DEBUG(A, B)
Define log for debug info.
Definition: pzlog.h:87
void EigenSystem(TPZDecomposed &eigensystem) const
Definition: TPZTensor.h:1265
void CopyFromTensorToFMatrix(TPZTensor< STATE > tensor, TPZFMatrix< STATE > &copy)
void Scale(const T2 &constant)
Definition: TPZTensor.h:792
int64_t Rows() const
Returns number of rows.
Definition: pzmatrix.h:803
expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ sqrt
Definition: tfadfunc.h:120
REAL NormVecOfMat(TPZFNMatrix< 9 > mat)
TPZTensor< T > m_eps_p
virtual void ApplyStressComputeStrain(const TPZTensor< REAL > &sigma, TPZTensor< REAL > &epsTotal, TPZFMatrix< REAL > *tangent_inv=NULL)
void Print(std::ostream &out) const
Definition: TPZTensor.h:1847
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
Definition: tfadfunc.h:130
T & XX() const
Definition: TPZTensor.h:566
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.
Definition: pzmatrix.cpp:1916
TPZFMatrix< REAL > ProdT(TPZManVector< REAL, 3 > &v1, TPZManVector< REAL, 3 > &v2)
Classe que efetua avanco de um passo de plastificacao utilizando o metodo de Newton.
virtual void ApplyLoad(const TPZTensor< REAL > &sigma, TPZTensor< REAL > &epsTotal) override
T & XY() const
Definition: TPZTensor.h:570
int64_t Cols() const
Returns number of cols.
Definition: pzmatrix.h:809
T & ZZ() const
Definition: TPZTensor.h:586
virtual void ApplyStrainComputeSigma(const TPZTensor< REAL > &epsTotal, TPZTensor< REAL > &sigma, TPZFMatrix< REAL > *tangent=NULL) override
virtual void Print(std::ostream &out) const
Definition: pzmatrix.h:253
int Resize(const int64_t newRows, const int64_t wCols) override
Redimension a matrix, but maintain your elements.
Definition: pzfmatrix.cpp:1016
REAL InnerVecOfMat(TPZFMatrix< REAL > &m1, TPZFMatrix< REAL > &m2)
Defines the interface for saving and reading data. Persistency.
Definition: TPZStream.h:50
T & XZ() const
Definition: TPZTensor.h:574
virtual TPZPlasticState< REAL > GetState() const override
void push_back(const T object)
Definition: pzstack.h:48
virtual void TrialStressCorrection(REAL kappa, TPZVec< STATE > &sigma, TPZVec< STATE > &sigma_tr)
Method that correct the Sigma trial based on the intersection with the yield surface.
void CopyFromFMatrixToTensor(TPZFMatrix< STATE > FNM, TPZTensor< STATE > &copy)
Object which represents the yield criterium.
virtual void Read(bool &val)
Definition: TPZStream.cpp:91