NeoPZ
pzelastoplasticanalysis.cpp
Go to the documentation of this file.
1 //$Id: pzelastoplasticanalysis.cpp,v 1.27 2010-11-23 18:58:05 diogo Exp $
3 #include "pzcmesh.h"
4 #include "pzvec.h"
5 #include "pzmanvector.h"
6 #include "checkconv.h"
7 #include "pzstrmatrix.h"
8 #include "TPZMatElastoPlastic.h"
9 #include "tpzautopointer.h"
10 #include "pzcompelwithmem.h"
11 #include "TPZElastoPlasticMem.h"
12 #include "pzblockdiag.h"
13 #include "TPZSpStructMatrix.h"
14 #include "pzfstrmatrix.h"
15 #include "pzbdstrmatrix.h"
16 #include "pzstepsolver.h"
17 #include "TPZMaterial.h"
18 #include "pzbndcond.h"
19 #include "TPZMatElastoPlastic2D.h"
20 
22 
23 #include <map>
24 #include <set>
25 #include <stdio.h>
26 #include <fstream>
27 
28 #include "pzsolve.h"
29 
30 #include "pzlog.h"
31 
32 #ifdef LOG4CXX
33 static LoggerPtr EPAnalysisLogger(Logger::getLogger("pz.analysis.elastoplastic"));
34 static LoggerPtr loggertest(Logger::getLogger("testing"));
35 #endif
36 
37 using namespace std;
38 
39 
41  //Mesh()->Solution().Zero(); already performed in the nonlinearanalysis base class
42  //fSolution.Zero();
43 }
44 
46 
47  int numeq = fCompMesh->NEquations();
48  fCumSol.Redim(numeq,1);
49  fCumSol.Zero();
50  fSolution.Redim(numeq,1);
51  fSolution.Zero();
52 
53  LoadSolution();
54 }
55 
57 {
58  if(fPrecond)delete fPrecond;
59 
60 #ifdef LOG4CXX
61 {
62  if(EPAnalysisLogger->isDebugEnabled()){
63  std::stringstream sout;
64  sout << "<<< TPZElastoPlasticAnalysis::~TPZElastoPlasticAnalysis() *** Killing Object\n";
65  LOGPZ_DEBUG(EPAnalysisLogger,sout.str().c_str());
66  }
67 }
68 #endif
69 }
70 
71 REAL TPZElastoPlasticAnalysis::LineSearch(const TPZFMatrix<REAL> &Wn, const TPZFMatrix<REAL> &DeltaW, TPZFMatrix<REAL> &NextW, REAL RhsNormPrev, REAL &RhsNormResult, int niter, bool & converging){
72 
73  TPZFMatrix<REAL> Interval = DeltaW;
74 
75 #ifdef PZDEBUG
76  {
79  STATE normprev = Norm(fRhs);
80  if (fabs(normprev - RhsNormPrev) > 1.e-6) {
81  std::stringstream sout;
82  sout << "Norm of Wn " << Norm(Wn) << std::endl;
83  sout << "Input previous norm " << RhsNormPrev << " Computed Norm " << normprev;
84  LOGPZ_ERROR(EPAnalysisLogger, sout.str())
85  }
86  }
87 #endif
88  REAL scalefactor = 1.;
89  int iter = 0;
90  do {
91  Interval *= scalefactor;
92  NextW = Wn;
93  NextW += Interval;
96 #ifdef PZDEBUGBIG
97  {
98  static int count = 0;
99  {
100  std::stringstream filename,varname;
101  filename << "Sol." << count << ".txt";
102  varname << "DelSol" << count << " = ";
103  ofstream out(filename.str().c_str());
104  Interval.Print(varname.str().c_str(),out,EMathematicaInput);
105  }
106  std::stringstream filename,varname;
107  filename << "Rhs." << count << ".txt";
108  varname << "Rhs" << count++ << " = ";
109  ofstream out(filename.str().c_str());
110  fRhs.Print(varname.str().c_str(),out,EMathematicaInput);
111  }
112 #endif
113  RhsNormResult = Norm(fRhs);
114 #ifndef PLASTICITY_CLEAN_OUT
115  std::cout << "scale factor " << scalefactor << " residure norm " << RhsNormResult << std::endl;
116 #endif
117  scalefactor *= 0.5;
118  iter++;
119  } while (RhsNormResult > RhsNormPrev && iter < niter);
120  if(fabs(RhsNormResult - RhsNormPrev)<1.e-6 )
121  {
122  converging=false;
123  }
124  else
125  {
126  converging=true;
127  }
128  scalefactor *= 2.;
129  return scalefactor;
130 
131 }//void
132 
134 
135 void TPZElastoPlasticAnalysis::IterativeProcess(std::ostream &out, REAL tol, int numiter, int niter_update_jac, bool linesearch) {
136 
137  // Initial guess and update it
138  fSolution.Zero();
139  LoadSolution();
140 
141  // Auxiliary previous solution
143 
144  TPZAnalysis::Assemble(); // starting with consistent jacobian
145  REAL residue_norm_prev = Norm(fRhs);
146  std::cout.precision(3);
148  bool linesearchconv = true;
149 
150  REAL residue_norm;
151  REAL deltax_norm;
152  bool stop_criterion;
153  unsigned int i;
154  for(i = 1 ; i <= numiter; i++) {
155 
156  Solve();
157  deltax_norm = Norm(fSolution);// At this line fSolution is dx
158 
159  if (linesearch) {
160  TPZFMatrix<STATE> solkeep(fSolution);
161  {
162  TPZFMatrix<STATE> nextsol(x);
163  nextsol += solkeep;
165  if (i%niter_update_jac) {
167  }else{
168  Assemble();
169  std::cout << "Jacobian updated at iteration = " << i << endl;
170  out << "Jacobian updated at iteration = " << i << endl;
171  }
172  residue_norm = Norm(fRhs);
173  }
174  if (residue_norm > tol && residue_norm > residue_norm_prev) {
175  fSolution = x;
176  TPZFMatrix<REAL> nextSol;
177  const int niter = 5;
178  this->LineSearch(x, solkeep, nextSol, residue_norm_prev, residue_norm, niter, linesearchconv);
179  fSolution = nextSol;
180  }
181  x -= fSolution;
182  REAL normDeltaSol = Norm(x);
183  x = fSolution;
184  } else {
185 
186  fSolution += x; // At this line fSolution is x+1
187  LoadSolution();
188 
189  if (i%niter_update_jac) {
191  }else{
192  Assemble();
193  std::cout << "Jacobian updated at iteration = " << i << endl;
194  out << "Jacobian updated at iteration = " << i << endl;
195  }
196 
197  residue_norm = Norm(fRhs);
198  x = fSolution; // At this line x = x+1
199 
200  }
201 
202  stop_criterion = residue_norm < tol;
203  if (stop_criterion) {
204  std::cout << std::endl;
205  std::cout << "Tolerance obtained at iteration : " << setw(5) << i << endl;
206  std::cout << "Residue Norm |r| : " << setw(5) << residue_norm << endl;
207  std::cout << "Correction Norm |dx| : " << setw(5) << deltax_norm << endl;
208  out << "Tolerance obtained at Iteration number : " << i << endl;
209  out << "Residue Norm |r| : " << residue_norm << endl;
210  out << "Correction Norm |dx| : " << deltax_norm << endl;
211  std::cout << std::endl;
212  break;
213  } else if (residue_norm - residue_norm_prev > 0.0)
214  {
215  std::cout << "\nDivergent Method\n";
216  out << "Divergent Method norm = " << residue_norm_prev << "\n";
217  }
218 
219  residue_norm_prev = residue_norm;
220  std::cout << "Iteration n : " << setw(4) << i << setw(4) << " : correction / residue norms |du| / |r| : " << setw(5) << deltax_norm << " / " << setw(5) << residue_norm << std::scientific << endl;
221  out << "Iteration n : " << setw(4) << i << setw(4) << " : correction / residue norms |du| / |r| : " << setw(5) << deltax_norm << " / " << setw(5) << residue_norm << std::scientific << endl;
222  out.flush();
223  }
224 
225  if (i == numiter + 1) {
226  std::cout << std::endl;
227  std::cout << "Solution not converged. Rollback and try with more steps." << endl;
228  out << "Solution not converged. Rollback and try with more steps." << endl;
229  std::cout << std::endl;
230  }
231 
232 }
233 
234 
235 void TPZElastoPlasticAnalysis::IterativeProcessPrecomputedMatrix(std::ostream &out, REAL tol, int numiter, bool linesearch) {
236 
237  // Initial guess and update it
238  fSolution.Zero();
239  LoadSolution();
240 
241  // Auxiliary previous solution
243 
244  TPZAnalysis::AssembleResidual(); // starting with consistent jacobian
245  REAL residue_norm_prev = Norm(fRhs);
246  std::cout.precision(3);
247 
248  bool linesearchconv = true;
249 
250  REAL residue_norm;
251  REAL deltax_norm;
252  bool stop_criterion;
253  unsigned int i;
254  for(i = 1 ; i <= numiter; i++) {
255 
256  Solve();
257  deltax_norm = Norm(fSolution);// At this line fSolution is dx
258 
259  if (linesearch) {
260  TPZFMatrix<STATE> solkeep(fSolution);
261  {
262  TPZFMatrix<STATE> nextsol(x);
263  nextsol += solkeep;
266  residue_norm = Norm(fRhs);
267  }
268  if (residue_norm > tol && residue_norm > residue_norm_prev) {
269  fSolution = x;
270  TPZFMatrix<REAL> nextSol;
271  const int niter = 5;
272  this->LineSearch(x, solkeep, nextSol, residue_norm_prev, residue_norm, niter, linesearchconv);
273  fSolution = nextSol;
274  }
275  x -= fSolution;
276  REAL normDeltaSol = Norm(x);
277  x = fSolution;
278  } else {
279 
280  fSolution += x; // At this line fSolution is x+1
281  LoadSolution();
283 
284  residue_norm = Norm(fRhs);
285  x = fSolution; // At this line x = x+1
286 
287  }
288 
289  stop_criterion = residue_norm < tol;
290  if (stop_criterion) {
291  std::cout << std::endl;
292  std::cout << "Tolerance obtained at iteration : " << setw(5) << i << endl;
293  std::cout << "Residue Norm |r| : " << setw(5) << residue_norm << endl;
294  out << "Tolerance obtained at Iteration number : " << i << endl;
295  out << "Residue Norm |r| : " << residue_norm << endl;
296  std::cout << std::endl;
297  break;
298  } else if (residue_norm - residue_norm_prev > 0.0)
299  {
300  std::cout << "\nDivergent Method\n";
301  out << "Divergent Method norm = " << residue_norm_prev << "\n";
302  }
303 
304  residue_norm_prev = residue_norm;
305  std::cout << "Iteration n : " << setw(4) << i << setw(4) << " : correction / residue norms |du| / |r| : " << setw(5) << deltax_norm << " / " << setw(5) << residue_norm << std::scientific << endl;
306  out << "Iteration n : " << setw(4) << i << setw(4) << " : correction / residue norms |du| / |r| : " << setw(5) << deltax_norm << " / " << setw(5) << residue_norm << std::scientific << endl;
307  out.flush();
308  }
309 
310  if (i == numiter + 1) {
311  std::cout << std::endl;
312  std::cout << "Solution not converged. Rollback and try with more steps." << endl;
313  out << "Solution not converged. Rollback and try with more steps." << endl;
314  std::cout << std::endl;
315  }
316 
317 }
318 
319 void TPZElastoPlasticAnalysis::IterativeProcess(std::ostream &out,REAL tol,int numiter, bool linesearch, bool checkconv,bool &ConvOrDiverg) {
320 
321  int iter = 0;
322  REAL error = 1.e10;
323  int numeq = fCompMesh->NEquations();
324  Mesh()->Solution().Zero();
325  fSolution.Zero();
326 
327 
328 
329  TPZFMatrix<REAL> prevsol(fSolution);
330  if(prevsol.Rows() != numeq)
331  {
332  prevsol.Redim(numeq,1);
333  DebugStop();
334  }
335 
336 #ifdef LOG4CXX_keep
337  {
338  std::stringstream sout;
339  fSolution.Print("Solution for checkconv",sout);
340  LOGPZ_DEBUG(EPAnalysisLogger, sout.str())
341  }
342 #endif
343 
344  if(checkconv){
345  TPZVec<REAL> coefs(1,1.);
346  TPZFMatrix<REAL> range(numeq,1,1.e-5);
347  CheckConvergence(*this,fSolution,range,coefs);
348  }
349 
350 // bool precond = false;
351  Assemble();
352  REAL RhsNormPrev = Norm(fRhs);
353 
354 #ifdef LOG4CXX
355  if (EPAnalysisLogger->isDebugEnabled()) {
356  std::stringstream sout;
357  PrintVectorByElement(sout, fRhs,1.e-5);
358  LOGPZ_DEBUG(EPAnalysisLogger, sout.str())
359  }
360 #endif
361  std::cout << "Rhs norm on entry " << RhsNormPrev << std::endl;
362 // {
363 // std::ofstream out("../RhsIn.txt");
364 // fRhs.Print("Rhs",out,EMathematicaInput);
365 // }
366  bool linesearchconv=true;
367 
368  while(error > tol && iter < numiter) {
369 
370  if(iter!=0)
371  {
372  Assemble();
373  }
374 
375  fSolution.Redim(0,0);
376  REAL RhsNormResult = 0.;
377  Solve();
378  STATE solutionNorm = Norm(fSolution);
379  std::cout << "Solution Norm " << solutionNorm << std::endl;
380  if (linesearch){
381  TPZFMatrix<REAL> nextSol;
382  const int niter = 2;
383  TPZFMatrix<STATE> computedsol(fSolution);
384  this->LineSearch(prevsol, computedsol, nextSol, RhsNormPrev, RhsNormResult, niter,linesearchconv);
385  fSolution = nextSol;
386  LoadSolution();
387  }
388  else{
389  fSolution += prevsol;
390  LoadSolution();
392  RhsNormResult = Norm(fRhs);
393  }
394 
395  prevsol -= fSolution;
396  REAL normDeltaSol = Norm(prevsol);
397  prevsol = fSolution;
398  REAL norm = RhsNormResult;
399  RhsNormPrev = RhsNormResult;
400  // out << "Iteracao n : " << (iter+1) << " : norma da solucao |Delta(Un)|: " << norm << endl;
401  std::cout << "Iteracao n : " << (iter+1) << " : normas |Delta(Un)| e |Delta(rhs)| : " << normDeltaSol << " / " << RhsNormResult << endl;
402 // std::cout << "Iteracao n : " << (iter+1) << " : fRhs : " << fRhs << endl;
403 
404  if(norm < tol) {
405  out << "Tolerancia atingida na iteracao : " << (iter+1) << endl;
406  out << "Iteracao n : " << (iter+1) << " : normas |Delta(Un)| e |Delta(rhs)| : " << normDeltaSol << " / " << RhsNormResult << endl;
407 // out << "Norma da solucao |Delta(Un)| : " << norm << endl << endl;
408  std::cout << "\nTolerancia atingida na iteracao : " << (iter+1) << endl;
409  std::cout << "\n\nNorma da solucao |Delta(Un)| : " << norm << endl << endl;
410  ConvOrDiverg=true;
411 
412  } else
413  if( (norm - error) > 1.e-9 || linesearchconv ==false) {
414  std::cout << "\nDivergent Method -- Exiting Consistent Tangent Iterative Process \n";
415  out << "Divergent Method -- Exiting Consistent Tangent Iterative Process \n";
416  std::cout << "\n Trying linearMatrix IterativeProcess \n\n";
417  ConvOrDiverg=false;
418  return;
419  }
420  error = norm;
421  iter++;
422  out.flush();
423  }
424 
425 }
426 
427 void TPZElastoPlasticAnalysis::IterativeProcess(std::ostream &out,REAL tol,int numiter, bool linesearch, bool checkconv) {
428 
429  int iter = 0;
430  REAL error = 1.e10;
431  int numeq = fCompMesh->NEquations();
432  //Mesh()->Solution().Zero();
433  //fSolution->Zero();
434 
435 
436 
437  TPZFMatrix<REAL> prevsol(fSolution);
438  if(prevsol.Rows() != numeq) prevsol.Redim(numeq,1);
439 
440 #ifdef LOG4CXX_keep
441  {
442  std::stringstream sout;
443  fSolution.Print("Solution for checkconv",sout);
444  LOGPZ_DEBUG(EPAnalysisLogger, sout.str())
445  }
446 #endif
447 
448  if(checkconv){
449  TPZVec<REAL> coefs(1,1.);
450  TPZFMatrix<REAL> range(numeq,1,1.e-5);
451  CheckConvergence(*this,fSolution,range,coefs);
452  }
453 
454  Assemble();
455  REAL RhsNormPrev = Norm(fRhs);
456  bool linesearchconv=true;
457  while(error > tol && iter < numiter) {
458 
459  fSolution.Redim(0,0);
460  REAL RhsNormResult = 0.;
461  Solve();
462  if (linesearch){
463  TPZFMatrix<REAL> nextSol;
464  const int niter = 10;
465  this->LineSearch(prevsol, fSolution, nextSol, RhsNormPrev, RhsNormResult, niter,linesearchconv);
466  fSolution = nextSol;
467  }
468  else{
469  fSolution += prevsol;
470  LoadSolution();
472  RhsNormResult = Norm(fRhs);
473  }
474 
475  prevsol -= fSolution;
476  REAL normDeltaSol = Norm(prevsol);
477  prevsol = fSolution;
478  REAL norm = RhsNormResult;
479  RhsNormPrev = RhsNormResult;
480  // out << "Iteracao n : " << (iter+1) << " : norma da solucao |Delta(Un)|: " << norm << endl;
481  std::cout << "Iteracao n : " << (iter+1) << " : normas |Delta(Un)| e |Delta(rhs)| : " << normDeltaSol << " / " << RhsNormResult << endl;
482  // std::cout << "Iteracao n : " << (iter+1) << " : fRhs : " << fRhs << endl;
483 
484  if(norm < tol) {
485  std::cout << "\nTolerancia atingida na iteracao : " << (iter+1) << endl;
486  std::cout << "\n\nNorma da solucao |Delta(Un)| : " << norm << endl << endl;
487 
488  } else
489  if( (norm - error) > 1.e-9 ) {
490  std::cout << "\nDivergent Method \n";
491 
492  }
493  error = norm;
494  iter++;
495  out.flush();
496  }
497 
498 }
499 
500 
501 
502 
504 {
505  if(!fCompMesh)return;
506 
507  std::map<int, TPZMaterial *> & refMatVec = fCompMesh->MaterialVec();
508 
509  std::map<int, TPZMaterial * >::iterator mit;
510 
511  TPZMatWithMem<TPZElastoPlasticMem> * pMatWithMem; // defined in file pzelastoplastic.h
512  TPZMatWithMem<TPZPoroElastoPlasticMem> * pMatWithMem2; // define in file pzporous.h
513 
514 // TPZMatElastoPlasticSest2D< TPZElasticCriteria >
515 
516  for(mit=refMatVec.begin(); mit!= refMatVec.end(); mit++)
517  {
518  pMatWithMem = dynamic_cast<TPZMatWithMem<TPZElastoPlasticMem> *>( mit->second );
519  if(pMatWithMem != NULL)
520  {
521  pMatWithMem->SetUpdateMem(update);
522  }
523  pMatWithMem2 = dynamic_cast<TPZMatWithMem<TPZPoroElastoPlasticMem> *>( mit->second);
524  if(pMatWithMem2 != NULL)
525  {
526  pMatWithMem2->SetUpdateMem(update);
527  }
528  }
529 
530 }
531 
532 #include "pzelasmat.h"
533 
534 REAL TPZElastoPlasticAnalysis::AcceptSolution(const int ResetOutputDisplacements)
535 {
536 
538  if (!mat) {
539  DebugStop();
540  }
541  TPZElasticityMaterial *elasmat = dynamic_cast<TPZElasticityMaterial *>(mat);
542  if(elasmat)
543  {
544  // the material is linear
545  return 0.;
546  }
547 
548 
549  if(ResetOutputDisplacements)
550  {
551  fCumSol.Zero();
552  }else{
553  fCumSol += fSolution;
554  }
555 
556  #ifdef LOG4CXX
557  {
558  if (EPAnalysisLogger->isDebugEnabled()){
559  std::stringstream sout;
560  sout << ">>> TTPZElastoPlasticAnalysis::AcceptSolution *** "
561  << " with Norm(fCumSol) = " << Norm(fCumSol);
562  LOGPZ_DEBUG(EPAnalysisLogger,sout.str().c_str());
563  }
564  }
565  #endif
566 
567  this->SetUpdateMem(true);
568 
569  fRhs.Zero();
570 
572  REAL norm = Norm(fRhs);
573 
574  this->SetUpdateMem(false);
575 
576  fSolution.Zero();
577 
578  LoadSolution();
579 
580 
581  return norm;
582 }
583 
586 {
588  if (this->IsMultiPhysicsConfiguration()) {
590  }
591 
592 }
593 
594 
595 
596 void TPZElastoPlasticAnalysis::CheckConv(std::ostream &out, REAL range) {
597 
598 #ifdef LOG4CXX
599 {
600  std::stringstream sout;
601  sout << ">>> TPZElastoPlasticAnalysis::CheckConv() ***"
602  << "\nEntering method with parameters:"
603  << "\n range = " << range;
604  LOGPZ_INFO(EPAnalysisLogger,sout.str().c_str());
605 }
606 #endif
607 
608  int numeq = fCompMesh->NEquations();
609 
610  TPZFMatrix<REAL> rangeMatrix(numeq, 1, range);
611 
612  TPZVec<REAL> coefs(1,1.);
613 
614  CheckConvergence(*this,fSolution,rangeMatrix,coefs);
615 
616 }
617 
619 
620  int neq = fCompMesh->NEquations();
621  tangent.Redim(neq,neq);
622  TPZFMatrix<REAL> rhs(neq,1);
623  TPZFStructMatrix substitute(Mesh());
624  TPZAutoPointer<TPZGuiInterface> guiInterface(0);
625  substitute.Assemble(tangent,rhs,guiInterface);
626 // TPZStructMatrix::Assemble(tangent, rhs, *Mesh());
627 }
628 
630  return 1;
631 }
632 
634  int neq = fCompMesh->NEquations();
635 // TPZFMatrix<REAL> tangent(neq,neq);
636  residual.Redim(neq,1);
637  TPZFStructMatrix substitute(Mesh());
638  TPZAutoPointer<TPZGuiInterface> guiInterface(0);
639  substitute.Assemble(residual,guiInterface);
640 // TPZStructMatrix::Assemble(/*tangent,*/ residual, *Mesh());
641  residual *= -1;
642 }
643 
645  if(fPrecond) delete fPrecond;
646  fPrecond = (TPZMatrixSolver<REAL> *) precond.Clone();
647 }
648 
650 {
651  if(fPrecond)
652  {
653  TPZMatrix<REAL> * pMatrix = TPZAnalysis::fSolver->Matrix().operator->();
654  TPZMatrix<REAL> * pPrecondMat = fPrecond->Matrix().operator->();
655  pPrecondMat->Zero();
656  TPZBlockDiagonal<REAL> *pBlock = dynamic_cast<TPZBlockDiagonal<REAL> *>(pPrecondMat);
657  pBlock->BuildFromMatrix(*pMatrix);
658  }
659 }
660 
662 {
663 #ifdef LOG4CXX
664 {
665  std::stringstream sout;
666  sout << ">>> TPZElastoPlasticAnalysis::SetBiCGStab() *** numiter = " << numiter << " and tol=" << tol;
667  LOGPZ_INFO(EPAnalysisLogger,sout.str().c_str());
668 }
669 #endif
670 
671  TPZSpStructMatrix StrMatrix(Mesh());
672  this->SetStructuralMatrix(StrMatrix);
673  TPZMatrix<REAL> * mat = StrMatrix.Create();
674 
675  TPZBlockDiagonalStructMatrix strBlockDiag(Mesh());
678 
679 #ifdef LOG4CXX
680 {
681  std::stringstream sout;
682  sout << "*** TPZElastoPlasticAnalysis::SetBiCGStab() *** Assembling Block Diagonal Preconditioning matrix\n";
683  LOGPZ_INFO(EPAnalysisLogger,sout.str().c_str());
684 }
685 #endif
686 
687  strBlockDiag.AssembleBlockDiagonal(*block); // just to initialize structure
688  Pre.SetMatrix(block);
689  Pre.SetDirect(ELU);
691  Solver.SetBiCGStab(numiter, Pre, tol, 0);
692  Solver.SetMatrix(mat);
693  this->SetSolver(Solver);
694  this->SetPrecond(Pre);
695 
696 #ifdef LOG4CXX
697 {
698  std::stringstream sout;
699  sout << "<<< TPZElastoPlasticAnalysis::SetBiCGStab() *** Exiting\n";
700  LOGPZ_INFO(EPAnalysisLogger,sout.str().c_str());
701 }
702 #endif
703 
704 }
705 
706 
708 {
709 #ifdef LOG4CXX
710 {
711  std::stringstream sout;
712  sout << ">>> TPZElastoPlasticAnalysis::SetBiCGStab_Jacobi() *** numiter = " << numiter << " and tol=" << tol;
713  LOGPZ_INFO(EPAnalysisLogger,sout.str().c_str());
714 }
715 #endif
716 
717  TPZSpStructMatrix StrMatrix(Mesh());
718 // TPZFStructMatrix StrMatrix(Mesh());
719  this->SetStructuralMatrix(StrMatrix);
720  TPZMatrix<REAL> * mat = StrMatrix.Create();
721 
722  TPZBlockDiagonalStructMatrix strBlockDiag(Mesh());
725 
726 #ifdef LOG4CXX
727 {
728  std::stringstream sout;
729  sout << "*** TPZElastoPlasticAnalysis::SetBiCGStab_Jacobi() *** Assembling Block Diagonal Preconditioning matrix\n";
730  LOGPZ_INFO(EPAnalysisLogger,sout.str().c_str());
731 }
732 #endif
733 
734  strBlockDiag.AssembleBlockDiagonal(*block); // just to initialize structure
735  Pre.SetMatrix(block);
736  // Pre.SetDirect(ELU);
737  //Pre.SetDirect(ELDLt);
738  Pre.SetJacobi(numiter, tol, 0);
740  Solver.SetBiCGStab(numiter, Pre, tol, 0);
741  Solver.SetMatrix(mat);
742  this->SetSolver(Solver);
743  this->SetPrecond(Pre);
744 
745 #ifdef LOG4CXX
746 {
747  std::stringstream sout;
748  sout << "<<< TPZElastoPlasticAnalysis::SetBiCGStab_Jacobi() *** Exiting\n";
749  LOGPZ_INFO(EPAnalysisLogger,sout.str().c_str());
750 }
751 #endif
752 }
753 
755 {
756 #ifdef LOG4CXX
757 {
758  std::stringstream sout;
759  sout << ">>> TPZElastoPlasticAnalysis::SetLU() ***\n";
760  LOGPZ_INFO(EPAnalysisLogger,sout.str().c_str());
761 }
762 #endif
763 
764  TPZFStructMatrix StrMatrix(Mesh());
765  this->SetStructuralMatrix(StrMatrix);
766 
767  TPZMatrix<REAL> * mat = StrMatrix.Create();
768 
770  //Solver.SetDirect(ELU);// ECholesky -> simétrica e positiva definida
771  Solver.SetDirect(ELU);
772  Solver.SetMatrix(mat);
773 
774  this->SetSolver(Solver);
775 }
776 
778 {
779  TPZFMatrix<REAL> bkpSolution = fSolution;
780 
781 
782  fSolution = fCumSol;
783 // fSolution.Print();
784  LoadSolution();//Carrega a solucao convergida no analysis
785  //passa o cum sol para o post
786  ppanalysis.TransferSolution();//Transfere solucao convergida para o pos processamento
787 
788 
789  fSolution = bkpSolution;
790 
791  LoadSolution();
792 }
793 
794 void TPZElastoPlasticAnalysis::ManageIterativeProcess(std::ostream &out,REAL tol,int numiter,
795  int BCId, int nsteps, REAL PGRatio,
796  TPZFMatrix<REAL> & val1Begin, TPZFMatrix<REAL> & val1End,
797  TPZFMatrix<REAL> & val2Begin, TPZFMatrix<REAL> & val2End,
798  TPZPostProcAnalysis * ppAnalysis, int res)
799 {
800 
801  if(!fCompMesh)return;
802 
803 #ifdef LOG4CXX
804 {
805 
806  std::stringstream sout;
807  sout << "<<< TPZElastoPlasticAnalysis::ManageIterativeProcess() ***";
808  sout << "\nWith parameters:\n";
809  sout << "\ntol = " << tol;
810  sout << "\nnumiter = " << numiter;
811  sout << "\nBCId = " << BCId;
812  sout << "\nnsteps = " << nsteps;
813  sout << "\nPGRatio = " << PGRatio;
814  sout << "\nval1Begin = " << val1Begin;
815  sout << "\nval1End = " << val1End;
816  sout << "\nval2Begin = " << val2Begin;
817  sout << "\nval2End = " << val2End;
818  if(ppAnalysis)
819  {
820  sout << "\nppanalysis set";
821  }else
822  {
823  sout << "\nppanalysis NOT set";
824  }
825  LOGPZ_INFO(EPAnalysisLogger,sout.str().c_str());
826 }
827 #endif
828 
829  // computing the initial value for the PG progression such that its sum equals one;
830  REAL a0;
831  if(fabs(PGRatio - 1.) < 1.e-3)
832  {
833  a0 = 1. / REAL(nsteps);
834  }else{
835  a0 = (PGRatio - 1) / (pow(PGRatio,nsteps) - 1.);
836  }
837  TPZFNMatrix<36> val1(6,6,0.), deltaVal1(6,6,0.);
838  TPZFNMatrix< 6> val2(6,1,0.), deltaVal2(6,1,0.);
839 
840  deltaVal1 = val1End;
841  deltaVal1.ZAXPY(-1., val1Begin);
842  deltaVal2 = val2End;
843  deltaVal2.ZAXPY(-1., val2Begin);
844 
845  // ZAXPY operation: *this += alpha * p
846 
847  TPZMaterial * mat = fCompMesh->FindMaterial(BCId);
848  TPZBndCond * pBC = dynamic_cast<TPZBndCond *>(mat);
849  if(!pBC)return;
850 
851  int i;
852  for(i = 0; i < nsteps; i++)
853  {
854  REAL stepLen;
855  if(fabs(PGRatio - 1.) < 1.e-3)
856  {
857  stepLen = REAL(i+1) / REAL(nsteps);
858  }else{
859  stepLen = a0 * (pow(PGRatio,i+1) - 1) / (PGRatio - 1.);
860  }
861 
862  val1 = val1Begin;
863  val1.ZAXPY(stepLen, deltaVal1);
864  val2 = val2Begin;
865  val2.ZAXPY(stepLen, deltaVal2);
866 
867  pBC->Val1() = val1;
868  pBC->Val2() = val2;
869 
870  #ifdef LOG4CXX
871  {
872  std::stringstream sout;
873  sout << "*** TPZElastoPlasticAnalysis::ManageIterativeProcess() *** load step " << i;
874  sout << " stepLen = " << stepLen;
875  sout << "\nBC.val1() = " << val1;
876  sout << "\nBC.val2() = " << val2;
877  LOGPZ_INFO(EPAnalysisLogger,sout.str().c_str());
878  }
879  #endif
880 
881  bool linesearch = false;
882  bool checkconv = false;
883  bool convordiv;
884  IterativeProcess(out, tol, numiter, linesearch, checkconv,convordiv);
885 
886 
887  #ifdef LOG4CXX
888  {
889  std::stringstream sout;
890  sout << "*** TPZElastoPlasticAnalysis::ManageIterativeProcess() *** load step " << i << " ended";
891  LOGPZ_INFO(EPAnalysisLogger,sout.str().c_str());
892  }
893  #endif
894 
895  AcceptSolution();
896 
897  if(ppAnalysis)
898  {
899  #ifdef LOG4CXX
900  {
901  std::stringstream sout;
902  sout << "*** TPZElastoPlasticAnalysis::ManageIterativeProcess() *** PostProcessing ";
903  LOGPZ_INFO(EPAnalysisLogger,sout.str().c_str());
904  }
905  #endif
906  TransferSolution(*ppAnalysis);
907  ppAnalysis->PostProcess(res);
908  }
909  }
910 
911  #ifdef LOG4CXX
912  {
913  std::stringstream sout;
914  sout << "<<< TPZElastoPlasticAnalysis::ManageIterativeProcess() *** Exiting";
915  LOGPZ_INFO(EPAnalysisLogger,sout.str().c_str());
916  }
917  #endif
918 }
919 
920 // CompEl create Functions setup
921 
922 #include "pzintel.h"
923 //#include "pzelctempplus.h"
924 
925 #include "pzrefpoint.h"
926 #include "pzgeopoint.h"
927 #include "pzshapepoint.h"
928 #include "tpzpoint.h"
929 
930 #include "pzshapelinear.h"
931 #include "TPZGeoLinear.h"
932 #include "TPZRefLinear.h"
933 #include "tpzline.h"
934 
935 #include "pzshapetriang.h"
936 #include "pzreftriangle.h"
937 #include "pzgeotriangle.h"
938 #include "tpztriangle.h"
939 
940 #include "pzrefquad.h"
941 #include "pzshapequad.h"
942 #include "pzgeoquad.h"
943 #include "tpzquadrilateral.h"
944 
945 #include "pzshapeprism.h"
946 #include "pzrefprism.h"
947 #include "pzgeoprism.h"
948 #include "tpzprism.h"
949 
950 #include "pzshapetetra.h"
951 #include "pzreftetrahedra.h"
952 #include "pzgeotetrahedra.h"
953 #include "tpztetrahedron.h"
954 
955 #include "pzshapepiram.h"
956 #include "pzrefpyram.h"
957 #include "pzgeopyramid.h"
958 #include "tpzpyramid.h"
959 
960 #include "TPZGeoCube.h"
961 #include "pzshapecube.h"
962 #include "TPZRefCube.h"
963 #include "tpzcube.h"
964 
965 #include "pzelctemp.h"
966 
967 
969 {
970 /* pzgeom::TPZGeoPoint::fp = TPZElastoPlasticAnalysis::CreatePointElWithMem;
971  pzgeom::TPZGeoQuad::fp = TPZElastoPlasticAnalysis::CreateQuadElWithMem;
972  pzgeom::TPZGeoTriangle::fp = TPZElastoPlasticAnalysis::CreateTriangElWithMem;
973  pzgeom::TPZGeoPrism::fp = TPZElastoPlasticAnalysis::CreatePrismElWithMem;
974  pzgeom::TPZGeoTetrahedra::fp = TPZElastoPlasticAnalysis::CreateTetraElWithMem;
975  pzgeom::TPZGeoPyramid::fp = TPZElastoPlasticAnalysis::CreatePyramElWithMem;
976  pzgeom::TPZGeoCube::fp = TPZElastoPlasticAnalysis::CreateCubeElWithMem;
977 */
987  cmesh->ApproxSpace().SetCreateFunctions(functions);
988 
989 }
990 
992 {
993  return new TPZCompElWithMem< TPZIntelGen< pzshape::TPZShapeCube > >(mesh,gel,index);
994 }
995 
997 {
999 }
1000 
1002 {
1003  return new TPZCompElWithMem< TPZIntelGen< pzshape::TPZShapePoint > >(mesh,gel,index);
1004 }
1005 
1007 {
1008  return new TPZCompElWithMem< TPZIntelGen< pzshape::TPZShapePrism > >(mesh,gel,index);
1009 }
1010 
1012 {
1013  return new TPZCompElWithMem< TPZIntelGen< pzshape::TPZShapePiram > >(mesh,gel,index);
1014 }
1015 
1017 {
1018 // return new TPZCompElWithMem< TPZIntelGenPlus<TPZIntelGen< pzshape::TPZShapeQuad > > >(mesh,gel,index);
1019  return new TPZCompElWithMem< TPZIntelGen< pzshape::TPZShapeQuad > > (mesh,gel,index);
1020 }
1021 
1023 {
1024  return new TPZCompElWithMem< TPZIntelGen< pzshape::TPZShapeTetra > >(mesh,gel,index);
1025 }
1026 
1028 {
1029  return new TPZCompElWithMem< TPZIntelGen< pzshape::TPZShapeTriang > >(mesh,gel,index);
1030 }
1031 
1033 {
1034  fEquationstoZero.clear();
1035  int64_t nel = fCompMesh->NElements();
1036  for (int64_t iel=0; iel<nel; iel++) {
1037  TPZCompEl *cel = fCompMesh->ElementVec()[iel];
1038  if (!cel) {
1039  continue;
1040  }
1041  TPZMaterial *mat = cel->Material();
1042  if (!mat) {
1043  continue;
1044  }
1045  int matid = mat->Id();
1046  if (fMaterialIds.find(matid) == fMaterialIds.end()) {
1047  continue;
1048  }
1049  std::pair<std::multimap<int, int>::iterator,std::multimap<int, int>::iterator> ret;
1050  ret = fMaterialIds.equal_range(matid);
1051  std::multimap<int, int>::iterator it;
1052  for (it=ret.first; it != ret.second; it++)
1053  {
1054  int direction = it->second;
1055  int64_t nc = cel->NConnects();
1056  for (int64_t ic=0; ic<nc; ic++) {
1057  TPZConnect &c = cel->Connect(ic);
1058  int64_t seqnum = c.SequenceNumber();
1059  int64_t pos = fCompMesh->Block().Position(seqnum);
1060  int blsize = fCompMesh->Block().Size(seqnum);
1061  for (int64_t i=pos+direction; i<pos+blsize; i+=2) {
1062  fEquationstoZero.insert(i);
1063  }
1064  }
1065  }
1066  }
1067 #ifdef LOG4CXX
1068  {
1069  if(EPAnalysisLogger->isDebugEnabled())
1070  {
1071  std::stringstream sout;
1072  sout << "Equations to zero ";
1073  std::set<int64_t>::iterator it;
1074  for (it=fEquationstoZero.begin(); it!= fEquationstoZero.end(); it++) {
1075  sout << *it << " ";
1076  }
1077  LOGPZ_DEBUG(EPAnalysisLogger, sout.str())
1078  }
1079  }
1080 #endif
1081 }
1082 
1085 {
1086  int64_t neq = fCompMesh->NEquations();
1087  TPZVec<int> equationflag(neq,1);
1088  typedef std::set<int64_t>::iterator setit;
1089  for (setit it = fEquationstoZero.begin(); it != fEquationstoZero.end(); it++) {
1090  equationflag[*it] = 0;
1091  }
1092  activeEquations.resize(neq-fEquationstoZero.size());
1093  int64_t count = 0;
1094  for (int64_t i=0; i<neq; i++) {
1095  if (equationflag[i]==1) {
1096  activeEquations[count++] = i;
1097  }
1098  }
1099 }
1100 
1101 
int64_t NElements() const
Number of computational elements allocated.
Definition: pzcmesh.h:169
TPZMatrixSolver< STATE > * fSolver
Type of solver to be applied.
Definition: pzanalysis.h:52
void SetUpdateMem(int update)
Forces the materials with memory to update the internal plastic memory during the subsequent assemble...
Contains TPZShapeTetra class which implements the shape functions of a tetrahedral element...
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...
Definition: checkconv.h:23
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
TPZCompMesh * fMultiPhysics
The multiphysics mesh.
TPZElastoPlasticAnalysis()
Default constructor.
Contains declaration of TPZIntelGen class which implements a generic computational element...
int Position(const int block_diagonal) const
Returns the position of first element block dependent on matrix diagonal.
Definition: pzblock.h:177
void ZAXPY(const TVar alpha, const TPZFMatrix< TVar > &p)
Performs an ZAXPY operation being *this += alpha * p.
Definition: pzfmatrix.cpp:879
filename
Definition: stats.py:82
Represents a set of shape functions associated with a computational element/side. Computational Eleme...
Definition: pzconnect.h:30
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.
virtual void Solve()
Invert the stiffness matrix.
Definition: pzanalysis.cpp:352
void SetStructuralMatrix(TPZAutoPointer< TPZStructMatrix > strmatrix)
Set structural matrix as auto pointer for analysis.
Definition: pzanalysis.cpp:82
Implements a vector class which allows to use external storage provided by the user. Utility.
Definition: pzquad.h:16
Implements Block Diagonal Structural Matrices. Structural Matrix.
Definition: pzbdstrmatrix.h:21
TPZFMatrix< STATE > fSolution
Solution vector.
Definition: pzanalysis.h:50
static TPZCompEl * CreatePrismElWithMem(TPZGeoEl *gel, TPZCompMesh &mesh, int64_t &index)
virtual void Residual(TPZFMatrix< REAL > &residual, int icase)
virtual void resize(const int64_t newsize)
Definition: pzvec.h:213
Contains the declaration of the TPZCompElWithMem class, it is as TPZCompEl with enable material memor...
int64_t NEquations()
This computes the number of equations associated with non-restrained nodes.
Definition: pzcmesh.cpp:721
Templated vector implementation.
void TransferSolution()
virtual int Zero()
Zeroes the matrix.
Definition: pzmatrix.h:296
Defines step solvers class. Solver.
Definition: pzmganalysis.h:17
void SetSolver(TPZMatrixSolver< STATE > &solver)
Set solver matrix.
TPZCompMesh * fCompMesh
Computational mesh.
Definition: pzanalysis.h:44
void BuildFromMatrix(TPZMatrix< TVar > &matrix)
Builds a block from matrix.
Contains the TPZPoint class which defines the topology of a point.
static void TransferFromMultiPhysics(TPZVec< TPZCompMesh *> &cmeshVec, TPZCompMesh *MFMesh)
Transfer information from a specific mesh multiphysics for the current specific set of meshes...
Contains the TPZRefQuad class which implements the uniform refinement of a geometric quadrilateral el...
virtual void Assemble()
Assemble the stiffness matrix and load vector.
Definition: pzanalysis.cpp:304
void PrintVectorByElement(std::ostream &out, TPZFMatrix< STATE > &vec, REAL tol=1.e-10)
Print the residual vector for those elements with entry above a given tolerance.
TPZCompMesh * Mesh() const
Returns the pointer to the computational mesh.
Definition: pzanalysis.h:180
static TPZCompEl * CreatePyramElWithMem(TPZGeoEl *gel, TPZCompMesh &mesh, int64_t &index)
void SetCreateFunctions(TPZVec< TCreateFunction > &createfuncs)
Set custom function pointers.
void SetBiCGStab_Jacobi(int numiter, REAL tol)
virtual void ComputeTangent(TPZFMatrix< REAL > &tangent, TPZVec< REAL > &coefs, int icase)
void CheckConv(std::ostream &out, REAL range)
Contains the TPZStructMatrixOR class which responsible for a interface among Matrix and Finite Elemen...
Contains TPZBlockDiagonal class which defines block diagonal matrices.
virtual void LoadSolution()
Load the solution into the computable grid, transfering it to the multi physics meshes.
TPZMatrixSolver< STATE > & Solver()
Get the solver matrix.
Definition: pzanalysis.h:367
Implements an abstract class implementing the memory features.
Definition: TPZMatWithMem.h:23
TPZFMatrix< STATE > & Val2(int loadcase=0)
Definition: pzbndcond.h:255
Contains the TPZTriangle class which defines the topology of a triangle.
virtual REAL AcceptSolution(const int ResetOutputDisplacements=0)
Informs the materials to update the plastic memory, assembles the rhs in order to update the memory a...
Contains TPZShapeLinear class which implements the shape functions of a linear one-dimensional elemen...
Contains the TPZRefPyramid class which implements the uniform refinement of a geometric hexahedral el...
Contains the TPZTetrahedron class which defines the topology of the tetrahedron element.
void TransferSolution(TPZPostProcAnalysis &ppanalysis)
Contains the TPZFStructMatrix class which implements Full Structural Matrices.
void IdentifyEquationsToZero()
build the fEquationstoZero datastructure based on the fMaterialIds data structure ...
Contains the TPZBlockDiagonalStructMatrix class which implements Block Diagonal Structural Matrices...
void error(char *string)
Definition: testShape.cc:7
This abstract class defines the behaviour which each derived class needs to implement.
Definition: TPZMaterial.h:39
Contains TPZShapeCube class which implements the shape functions of a hexaedral element.
Contains the TPZBndCond class which implements a boundary condition for TPZMaterial objects...
virtual TPZMaterial * Material() const
Identify the material object associated with the element.
Definition: pzcompel.cpp:959
TPZManVector< TPZCompMesh *, 2 > fMeshVec
The elasticity mesh and vertical deformation mesh.
void SetJacobi(const int64_t numiterations, const REAL tol, const int64_t FromCurrent)
int Zero() override
Makes Zero all the elements.
Definition: pzfmatrix.h:651
virtual void IterativeProcessPrecomputedMatrix(std::ostream &out, REAL tol, int numiter, bool linesearch)
Contains the TPZSpStructMatrix class which implements sparse structural matrices. ...
Contains the TPZRefPrism class which implements the uniform refinement of a geometric prism element...
TPZCreateApproximationSpace & ApproxSpace()
Definition: pzcmesh.h:498
int64_t SequenceNumber() const
Returns the Sequence number of the connect object.
Definition: pzconnect.h:158
static const double tol
Definition: pzgeoprism.cpp:23
TPZMatrixSolver< REAL > * fPrecond
#define LOGPZ_INFO(A, B)
Define log for informations.
Definition: pzlog.h:89
Defines the behaviour of all geometric elements. GeometryTPZGeoEl is the common denominator for all g...
Definition: pzgeoel.h:43
TVar Norm(const TPZFMatrix< TVar > &A)
Returns the norm of the matrix A.
Contains the TPZGeoTetrahedra class which implements the geometry of a tetrahedral element...
#define DebugStop()
Returns a message to user put a breakpoint in.
Definition: pzerror.h:20
std::set< int64_t > fEquationstoZero
Equations with zero dirichlet boundary condition.
#define LOGPZ_DEBUG(A, B)
Define log for debug info.
Definition: pzlog.h:87
static TPZCompEl * CreateTetraElWithMem(TPZGeoEl *gel, TPZCompMesh &mesh, int64_t &index)
This class defines the boundary condition for TPZMaterial objects.
Definition: pzbndcond.h:29
virtual void IterativeProcess(std::ostream &out, REAL tol, int numiter, int niter_update_jac, bool linesearch)
Iterative process using the linear elastic material as tangent matrix.
virtual void SetUpdateMem(bool update=1)
Sets/Unsets the internal memory data to be updated in the next assemble/contribute call...
Contains the TPZElasticityMaterial class which implements a two dimensional elastic material in plane...
Free store vector implementation.
static TPZCompEl * CreateCubeElWithMem(TPZGeoEl *gel, TPZCompMesh &mesh, int64_t &index)
Definition: pzmatrix.h:52
Contains the declaration of the TPZBuildmultiphysicsMesh class.
Contains the TPZQuadrilateral class which defines the topology of a quadrilateral element...
virtual void SetMatrix(TPZAutoPointer< TPZMatrix< TVar > > Refmat)
Sets a matrix to the current object.
Definition: pzsolve.h:115
TPZMaterial * FindMaterial(int id)
Find the material with identity id.
Definition: pzcmesh.cpp:297
int64_t Rows() const
Returns number of rows.
Definition: pzmatrix.h:803
string res
Definition: test.py:151
This class implements the TPZCompEl structure to enable material memory feature. It should be instan...
const TPZBlock< STATE > & Block() const
Access the block structure of the solution vector.
Definition: pzcmesh.h:213
Contains declaration of the TPZAutoPointer class which has Increment and Decrement actions are mutexe...
TPZFMatrix< STATE > & Val1()
Definition: pzbndcond.h:253
void SetBiCGStab(const int64_t numiterations, const TPZMatrixSolver< TVar > &pre, const REAL tol, const int64_t FromCurrent)
virtual ~TPZElastoPlasticAnalysis()
Default destructor.
virtual void LoadSolution()
Load the solution into the computable grid.
static TPZCompEl * CreateLinearElWithMem(TPZGeoEl *gel, TPZCompMesh &mesh, int64_t &index)
Contains TPZShapePoint class which implements the shape function associated with a point...
void UpdatePrecond()
Updates block diagonal preconditioning matrix.
#define LOGPZ_ERROR(A, B)
Define log for errors (cout)
Definition: pzlog.h:93
Contains declaration of TPZCompMesh class which is a repository for computational elements...
virtual void PostProcess(int resolution)
Draw solution over mesh for all dimensions.
int Redim(const int64_t newRows, const int64_t newCols) override
Redimension a matrix and ZERO your elements.
Definition: pzfmatrix.h:616
static TPZCompEl * CreateQuadElWithMem(TPZGeoEl *gel, TPZCompMesh &mesh, int64_t &index)
virtual void Assemble(TPZMatrix< STATE > &mat, TPZFMatrix< STATE > &rhs, TPZAutoPointer< TPZGuiInterface > guiInterface) override
Assemble the global system of equations into the matrix which has already been created.
Definition: pzstrmatrix.cpp:80
virtual TPZConnect & Connect(int i) const
Returns a pointer to the ith node.
Definition: pzcompel.cpp:298
Contains the TPZGeoCube class which implements the geometry of hexahedra element. ...
static TPZCompEl * CreateTriangElWithMem(TPZGeoEl *gel, TPZCompMesh &mesh, int64_t &index)
void GetActiveEquations(TPZVec< int64_t > &activeEquations)
return the vector of active equation indices
Contains the TPZPyramid class which defines the topology of a pyramid element.
static TPZCompEl * CreatePointElWithMem(TPZGeoEl *gel, TPZCompMesh &mesh, int64_t &index)
Contains the TPZGeoPoint class which implements the geometry of a point element or 0-D element...
std::map< int,TPZMaterial *> & MaterialVec()
Returns a reference to the material pointers vector.
Definition: pzcmesh.h:203
Contains the declaration of TPZElastoPlasticAnalysis class.
Contains TPZShapePrism class which implements the shape functions of a prism element.
virtual TPZSolver * Clone() const =0
Clones the current object returning a pointer of type TPZSolver.
virtual int NConnects() const =0
Returns the number of nodes of the element.
Implements Full Structural Matrices. Structural Matrix.
Definition: pzfstrmatrix.h:19
virtual REAL LineSearch(const TPZFMatrix< REAL > &Wn, const TPZFMatrix< REAL > &DeltaW, TPZFMatrix< REAL > &NextW, REAL RhsNormPrev, REAL &RhsNormResult, int niter, bool &converging)
void SetBiCGStab(int numiter, REAL tol)
Defines block diagonal matrices. Matrix.
Definition: pzblockdiag.h:21
Contains the TPZRefTriangle class which implements the uniform refinement of a geometric triangular e...
TPZFlopCounter pow(const TPZFlopCounter &orig, const TPZFlopCounter &xp)
Returns the power and increments the counter of the power.
Definition: pzreal.h:487
Contains the TPZRefTetrahedra class which implements the uniform refinement of a geometric tetrahedra...
virtual void AssembleResidual()
Assemble the load vector.
Definition: pzanalysis.cpp:288
void SetPrecond(TPZMatrixSolver< REAL > &precond)
Implements computational mesh. Computational Mesh.
Definition: pzcmesh.h:47
int Size(const int block_diagonal) const
Returns block dimension.
Definition: pzblock.h:171
TPZAdmChunkVector< TPZCompEl * > & ElementVec()
Returns a reference to the element pointers vector.
Definition: pzcmesh.h:183
Contains TPZSolver class which defines a abstract class of solvers which will be used by matrix class...
TPZAutoPointer< TPZMatrix< TVar > > Matrix() const
Returns a pointer to TPZMatrix<>
Definition: pzsolve.h:138
Definition: pzeltype.h:61
This class implements a two dimensional elastic material in plane stress or strain.
Definition: pzelasmat.h:19
Contains declaration of TPZInterpolatedElement class which implements computational element of the in...
Contains the TPZRefLinear class which implements the uniform refinement of a geometric linear element...
int Id() const
Definition: TPZMaterial.h:170
Contains TPZStepSolver class which defines step solvers class.
virtual void ManageIterativeProcess(std::ostream &out, REAL tol, int numiter, int BCId, int nsteps, REAL PGRatio, TPZFMatrix< REAL > &val1Begin, TPZFMatrix< REAL > &val1End, TPZFMatrix< REAL > &val2Begin, TPZFMatrix< REAL > &val2End, TPZPostProcAnalysis *ppAnalysis=NULL, int res=0)
The code below manages the update of a certain boundary condition (BCId) to assume values progressing...
Derived class from TPZAnalysis implements non linear analysis (Newton&#39;s method). Analysis.
Implements Sparse Structural Matrices. Structural Matrix.
virtual void Print(std::ostream &out) const
Definition: pzmatrix.h:253
Contains TPZShapePiram class which implements the shape functions of a pyramid element.
Contains the TPZGeoPyramid class which implements the geometry of pyramid element.
std::multimap< int, int > fMaterialIds
Materials with no penetration boundary conditions.
Contains the TPZGeoPrism class which implements the geometry of a prism element.
void SetDirect(const DecomposeType decomp)
Contains the TPZCube class which defines the topology of the hexahedron element.
Contains the TPZLine class which defines the topology of a line element.
TPZFMatrix< STATE > fRhs
Load vector.
Definition: pzanalysis.h:48
static void SetAllCreateFunctionsWithMem(TPZCompMesh *cmesh)
Definition: pzeltype.h:55
Contains the implementation of the CheckConvergence function.
void AssembleBlockDiagonal(TPZBlockDiagonal< STATE > &block)
Contains the TPZPrism class which defines the topology of a Prism.
Defines the interface of a computational element. Computational Element.
Definition: pzcompel.h:59
bool IsMultiPhysicsConfiguration()
Structure defining a multiphysics configuration.
Contains TPZShapeQuad class which implements the shape functions of a quadrilateral element...
Contains the TPZRefCube class which implements the uniform refinement of a geometric hexahedral eleme...
Contains the TPZRefPoint class which implements the uniform refinement of a geometric point element...
TPZFMatrix< STATE > & Solution()
Access the solution vector.
Definition: pzcmesh.h:219
Contains TPZShapeTriang class which implements the shape functions of a triangular element...
Non abstract class which implements full matrices with preallocated storage with (N+1) entries...
Definition: pzfmatrix.h:716