NeoPZ
TPZNLMultGridAnalysis.h
Go to the documentation of this file.
1 
6 #ifndef TPZNLMGANALYSIS_H
7 #define TPZNLMGANALYSIS_H
8 
9 #include <iosfwd> // for string, ostream
10 #include "pzanalysis.h" // for TPZAnalysis
11 #include "pzmatrix.h" // for TPZFMatrix, TPZMatrix
12 #include "pzreal.h" // for STATE, REAL
13 #include "pzstack.h" // for TPZStack
14 
15 class TPZCompMesh;
16 class TPZMaterial;
17 template <class TVar> class TPZMatrixSolver;
18 
19 
25 
28 
31 
34 
38 
40  clock_t fBegin,fInit;
41 
42 public:
43 
46 
49 
51  void AppendMesh (TPZCompMesh * mesh);
52 
54  TPZCompMesh *PopMesh ();
55 
57  int NMeshes() {return fMeshes.NElements();}
58 
59  TPZCompMesh *IMesh(int64_t index);
60 
69  static TPZCompMesh *UniformlyRefineMesh (TPZCompMesh *coarcmesh,int levelnumbertorefine,int setdegree);
70 
72  static TPZCompMesh *AgglomerateMesh(TPZCompMesh *finemesh,int levelnumbertogroup);
73 
74  void SmoothingSolution(REAL tol,int numiter,TPZMaterial * mat,TPZAnalysis &an,int marcha = 0 ,
75  const std::string &dxout = "plotfile.dx");
76 
77  void SmoothingSolution(REAL tol,int numiter,TPZMaterial * mat,TPZAnalysis &an,TPZFMatrix<STATE> &rhs);
78 
79  void SmoothingSolution2(REAL tol,int numiter,TPZMaterial * mat,TPZAnalysis &an,int marcha,
80  const std::string &dxout);
81 
82  void ResetReference(TPZCompMesh *aggcmesh);
83 
84  void SetReference(TPZCompMesh *aggcmesh);
85 
86  void SetDeltaTime(TPZCompMesh *CompMesh,TPZMaterial * mat);
87 
88  void CoutTime(clock_t &start,const char *title);
89 
90  void OneGridAlgorithm(std::ostream &out,int nummat);
91 
92  void TwoGridAlgorithm(std::ostream &out,int nummat);
93 
94  void CalcResidual(TPZMatrix<STATE> &sol,TPZAnalysis &an,const std::string &decompose,TPZFMatrix<STATE> &res);
95 
96  void CalcResidual(TPZMatrix<STATE> &sol,TPZFMatrix<STATE> &anres,TPZFMatrix<STATE> &res,TPZAnalysis &an,const std::string &decompose);
97 
98 protected:
99 
100  void (*fFunction)(TPZMaterial *mat,TPZCompMesh *cmesh);
101 
102 public:
103 
104  void SetAnalysisFunction(void (*fp)(TPZMaterial *mat,TPZCompMesh *cmesh)){
105  fFunction = fp;
106  }
107 
108 };
109 
110 #endif
Contains TPZAnalysis class which implements the sequence of actions to perform a finite element analy...
Implements multigrid analysis to Non linear problems. Class TPZNonLinMultGridAnalysis derived from TP...
clock_t fBegin
Times by iteration and accumulated time.
TPZNonLinMultGridAnalysis(TPZCompMesh *cmesh)
Creates an object multigrid analysis giving a computational mesh.
TPZStack< TPZFMatrix< STATE > * > fSolutions
Contains the meshes solutions.
void(* fFunction)(TPZMaterial *mat, TPZCompMesh *cmesh)
void TwoGridAlgorithm(std::ostream &out, int nummat)
Defines a class of matrix solvers. Solver.
Definition: pzanalysis.h:24
void SetDeltaTime(TPZCompMesh *CompMesh, TPZMaterial *mat)
TPZCompMesh * PopMesh()
Pop the last mesh of the meshes vector.
This abstract class defines the behaviour which each derived class needs to implement.
Definition: TPZMaterial.h:39
TPZStack< TPZMatrixSolver< STATE > * > fPrecondition
Contains the preconditioner of the solution method.
static const double tol
Definition: pzgeoprism.cpp:23
Implements the sequence of actions to perform a finite element analysis. Analysis.
Definition: pzanalysis.h:32
void CoutTime(clock_t &start, const char *title)
void CalcResidual(TPZMatrix< STATE > &sol, TPZAnalysis &an, const std::string &decompose, TPZFMatrix< STATE > &res)
TPZStack< TPZMatrixSolver< STATE > * > fSolvers
Contains the solution method applied to the mesh.
void SetAnalysisFunction(void(*fp)(TPZMaterial *mat, TPZCompMesh *cmesh))
void OneGridAlgorithm(std::ostream &out, int nummat)
void ResetReference(TPZCompMesh *aggcmesh)
TPZStack< TPZCompMesh *> fMeshes
Contains the computational meshes of one cycle: V, W, F, etc.
TPZCompMesh * IMesh(int64_t index)
string res
Definition: test.py:151
int NMeshes()
Number of meshes.
void AppendMesh(TPZCompMesh *mesh)
Append a mesh to the meshes vector.
A simple stack.
static TPZCompMesh * AgglomerateMesh(TPZCompMesh *finemesh, int levelnumbertogroup)
It generates a new mesh based on the agglomeration of elements of the fine mesh.
Contains TPZMatrix<TVar>class, root matrix class.
void SmoothingSolution2(REAL tol, int numiter, TPZMaterial *mat, TPZAnalysis &an, int marcha, const std::string &dxout)
This class implements a stack object. Utility.
Definition: pzcheckmesh.h:14
Implements computational mesh. Computational Mesh.
Definition: pzcmesh.h:47
void SmoothingSolution(REAL tol, int numiter, TPZMaterial *mat, TPZAnalysis &an, int marcha=0, const std::string &dxout="plotfile.dx")
void SetReference(TPZCompMesh *aggcmesh)
int64_t NElements() const
Returns the number of elements of the vector.
Definition: pzvec.h:190
Contains the declaration of TPZFlopCounter class and TPZCounter struct.
static TPZCompMesh * UniformlyRefineMesh(TPZCompMesh *coarcmesh, int levelnumbertorefine, int setdegree)
It creates a new established computational mesh in the refinement uniform of a fixed number of levels...