NeoPZ
pzelastoplasticanalysis.h
Go to the documentation of this file.
1 
6 #ifndef ELASTOPLASTICANALYSIS_H
7 #define ELASTOPLASTICANALYSIS_H
8 
9 #include "pznonlinanalysis.h"
10 #include "pzcompel.h"
11 #include "TPZGeoElement.h"
12 #include "pzfmatrix.h"
13 #include "pzvec.h"
14 #include "pzpostprocanalysis.h"
15 #include <iostream>
16 
17 
19 
20 public:
22  TPZElastoPlasticAnalysis(TPZCompMesh *mesh,std::ostream &out);
26  virtual ~TPZElastoPlasticAnalysis();
27 
28  virtual void IterativeProcessPrecomputedMatrix(std::ostream &out, REAL tol, int numiter, bool linesearch);
29 
31  virtual void IterativeProcess(std::ostream &out, REAL tol, int numiter, int niter_update_jac, bool linesearch);
32 
37  virtual void IterativeProcess(std::ostream &out,REAL tol,int numiter, bool linesearch, bool checkconv,bool &ConvOrDiverg);
38 
39  virtual void IterativeProcess(std::ostream &out,REAL tol,int numiter, bool linesearch, bool checkconv);
40 
41  //virtual REAL LineSearch(const TPZFMatrix<REAL> &Wn, const TPZFMatrix<REAL> &DeltaW, TPZFMatrix<REAL> &NextW, REAL RhsNormPrev, REAL &RhsNormResult, int niter);
42 
43  //Improved:A verification is made in order to check convergence.
44  virtual REAL LineSearch(const TPZFMatrix<REAL> &Wn, const TPZFMatrix<REAL> &DeltaW, TPZFMatrix<REAL> &NextW, REAL RhsNormPrev, REAL &RhsNormResult, int niter, bool &converging );
45 
64  virtual void ManageIterativeProcess(std::ostream &out,REAL tol,int numiter,
65  int BCId, int nsteps, REAL PGRatio,
66  TPZFMatrix<REAL> & val1Begin, TPZFMatrix<REAL> & val1End,
67  TPZFMatrix<REAL> & val2Begin, TPZFMatrix<REAL> & val2End,
68  TPZPostProcAnalysis * ppAnalysis = NULL, int res = 0);
69 
76  virtual REAL AcceptSolution(const int ResetOutputDisplacements = 0);
77 
79  virtual void LoadSolution();
80 
81 
83  {
84  return fCumSol;
85  }
86 
87  void SetPrecond(TPZMatrixSolver<REAL> &precond);
88 
89  void SetBiCGStab(int numiter, REAL tol);
90 
91  void SetBiCGStab_Jacobi(int numiter, REAL tol);
92 
93  void SetLU();
94 
95  void TransferSolution(TPZPostProcAnalysis & ppanalysis);
96 
97  void AddNoPenetration(int matid, int direction)
98  {
99  fMaterialIds.insert(std::pair<int,int>(matid, direction));
100  }
101 
104 
106  void GetActiveEquations(TPZVec<int64_t> &activeEquations);
107 
108 protected:
109 
117  void SetUpdateMem(int update);
118 
122  void UpdatePrecond();
123 
124 
125 public:
126 
127  void CheckConv(std::ostream &out, REAL range);
128 
129  virtual void ComputeTangent(TPZFMatrix<REAL> &tangent, TPZVec<REAL> &coefs, int icase);
130 
131  virtual int NumCases();
132 
133  virtual void Residual(TPZFMatrix<REAL> &residual, int icase);
134 
135  static void SetAllCreateFunctionsWithMem(TPZCompMesh *cmesh);
136 
139  {
140  return fMultiPhysics != NULL;
141  }
142 
145  {
146  fMultiPhysics = mphysics;
147  fMeshVec = meshvec;
148  }
149 
152  {
153  fMultiPhysics = 0;
154  fMeshVec.Resize(0);
155  }
156 
157 
158 protected:
159 
160  /* @brief Cumulative solution vector*/
162 
164 
166  std::set<int64_t> fEquationstoZero;
167 
169  // the second value of the map indicates x (0) or y (1) restraint
170  std::multimap<int,int> fMaterialIds;
171 
174 
177 
185  static TPZCompEl * CreateCubeElWithMem( TPZGeoEl *gel, TPZCompMesh &mesh, int64_t &index);
186  static TPZCompEl * CreateLinearElWithMem(TPZGeoEl *gel, TPZCompMesh &mesh, int64_t &index);
187  static TPZCompEl * CreatePointElWithMem( TPZGeoEl *gel, TPZCompMesh &mesh, int64_t &index);
188  static TPZCompEl * CreatePrismElWithMem( TPZGeoEl *gel, TPZCompMesh &mesh, int64_t &index);
189  static TPZCompEl * CreatePyramElWithMem( TPZGeoEl *gel, TPZCompMesh &mesh, int64_t &index);
190  static TPZCompEl * CreateQuadElWithMem( TPZGeoEl *gel, TPZCompMesh &mesh, int64_t &index);
191  static TPZCompEl * CreateTetraElWithMem( TPZGeoEl *gel, TPZCompMesh &mesh, int64_t &index);
192  static TPZCompEl * CreateTriangElWithMem(TPZGeoEl *gel, TPZCompMesh &mesh, int64_t &index);
193 
194 };
195 
196 #endif
197 
void SetUpdateMem(int update)
Forces the materials with memory to update the internal plastic memory during the subsequent assemble...
TPZCompMesh * fMultiPhysics
The multiphysics mesh.
TPZElastoPlasticAnalysis()
Default constructor.
static TPZCompEl * CreatePrismElWithMem(TPZGeoEl *gel, TPZCompMesh &mesh, int64_t &index)
virtual void Residual(TPZFMatrix< REAL > &residual, int icase)
Contains declaration of TPZCompEl class which defines the interface of a computational element...
Templated vector implementation.
static TPZCompEl * CreatePyramElWithMem(TPZGeoEl *gel, TPZCompMesh &mesh, int64_t &index)
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)
virtual void LoadSolution()
Load the solution into the computable grid, transfering it to the multi physics meshes.
void AddNoPenetration(int matid, int direction)
virtual void Resize(const int64_t newsize, const T &object)
Resizes the vector object.
Definition: pzmanvector.h:426
void SetMultiPhysics(TPZCompMesh *mphysics, TPZVec< TPZCompMesh *> &meshvec)
Initialize the multiphysics data structure.
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...
void TransferSolution(TPZPostProcAnalysis &ppanalysis)
void IdentifyEquationsToZero()
build the fEquationstoZero datastructure based on the fMaterialIds data structure ...
TPZManVector< TPZCompMesh *, 2 > fMeshVec
The elasticity mesh and vertical deformation mesh.
virtual void IterativeProcessPrecomputedMatrix(std::ostream &out, REAL tol, int numiter, bool linesearch)
static const double tol
Definition: pzgeoprism.cpp:23
TPZMatrixSolver< REAL > * fPrecond
Defines the behaviour of all geometric elements. GeometryTPZGeoEl is the common denominator for all g...
Definition: pzgeoel.h:43
Contains TPZMatrixclass which implements full matrix (using column major representation).
std::set< int64_t > fEquationstoZero
Equations with zero dirichlet boundary condition.
static TPZCompEl * CreateTetraElWithMem(TPZGeoEl *gel, TPZCompMesh &mesh, int64_t &index)
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.
static TPZCompEl * CreateCubeElWithMem(TPZGeoEl *gel, TPZCompMesh &mesh, int64_t &index)
string res
Definition: test.py:151
virtual ~TPZElastoPlasticAnalysis()
Default destructor.
static TPZCompEl * CreateLinearElWithMem(TPZGeoEl *gel, TPZCompMesh &mesh, int64_t &index)
void UpdatePrecond()
Updates block diagonal preconditioning matrix.
static TPZCompEl * CreateQuadElWithMem(TPZGeoEl *gel, TPZCompMesh &mesh, int64_t &index)
static TPZCompEl * CreateTriangElWithMem(TPZGeoEl *gel, TPZCompMesh &mesh, int64_t &index)
void GetActiveEquations(TPZVec< int64_t > &activeEquations)
return the vector of active equation indices
static TPZCompEl * CreatePointElWithMem(TPZGeoEl *gel, TPZCompMesh &mesh, int64_t &index)
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)
void ResetMultiPhysics()
Reset the multiphysics data structure.
void SetPrecond(TPZMatrixSolver< REAL > &precond)
Implements computational mesh. Computational Mesh.
Definition: pzcmesh.h:47
TPZFMatrix< REAL > & CumulativeSolution()
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.
std::multimap< int, int > fMaterialIds
Materials with no penetration boundary conditions.
Contains declaration of TPZGeoElement class which implements a generic geometric element with a unifo...
static void SetAllCreateFunctionsWithMem(TPZCompMesh *cmesh)
Defines the interface of a computational element. Computational Element.
Definition: pzcompel.h:59
bool IsMultiPhysicsConfiguration()
Structure defining a multiphysics configuration.
Contains TPZNonLinearAnalysis class which implements the non linear analysis.