NeoPZ
pzmgsolver.h
Go to the documentation of this file.
1 
6 #ifndef TPZMGSOLVER_H
7 #define TPZMGSOLVER_H
8 #include "pzsolve.h"
9 #include "pzstepsolver.h"
10 #include "pzfmatrix.h"
11 #include "pztransfer.h"
12 
14 #define TPZMGSOLVER_ID 28291008
15 
20 template <class TVar>
21 class TPZMGSolver: public TPZMatrixSolver<TVar>
22 {
23 public:
28  int nvar, TPZAutoPointer<TPZMatrix<TVar> > refmat);
31  int nvar);
32 
34  TPZMGSolver(const TPZMGSolver<TVar> & copy);
36  ~TPZMGSolver();
37 
41  void ResetTransferMatrix();
42 
45  {
46  return this->fTransfer;
47  }
48 
49  TPZSolver<TVar> * Clone() const override;
50 
51  void Solve(const TPZFMatrix<TVar> &F, TPZFMatrix<TVar> &result, TPZFMatrix<TVar> *residual = 0) override;
52 
53  public:
54 int ClassId() const override;
55 
56  void Write(TPZStream &buf, int withclassid) const override;
57  void Read(TPZStream &buf, void *context) override;
58 
59 
60 private:
62  int fNVar;
65  // TPZMatrixSolver::TPZContainer *fTransfer;
66 };
67 
68 template <class TVar>
70  return Hash("TPZMGSolver") ^ TPZMatrixSolver<TVar>::ClassId() << 1;
71 }
72 
73 #endif //TPZMGSOLVER_H
~TPZMGSolver()
Default destructor.
Definition: pzmgsolver.cpp:66
Defines a abstract class of solvers which will be used by matrix classes. Solver. ...
Definition: pzmatrix.h:32
TPZSolver< TVar > * Clone() const override
Clones the current object returning a pointer of type TPZSolver.
Definition: pzmgsolver.cpp:61
Defines a class of matrix solvers. Solver.
Definition: pzanalysis.h:24
TPZAutoPointer< TPZMatrix< TVar > > TransferMatrix()
Gets the transfer matrix.
Definition: pzmgsolver.h:44
Contains the TPZTransfer class which implements a rectangular sparse block matrix.
Contains TPZMatrixclass which implements full matrix (using column major representation).
TPZMGSolver()
Default constructor.
Definition: pzmgsolver.h:25
Represents a solution process in three steps: transfer of the residual, execute a solver on the coars...
Definition: pzmgsolver.h:21
Full matrix class. Matrix.
Definition: pzfmatrix.h:32
int32_t Hash(std::string str)
Definition: TPZHash.cpp:10
void Write(TPZStream &buf, int withclassid) const override
Writes this object to the TPZStream buffer. Include the classid if withclassid = true.
Definition: pzmgsolver.cpp:82
void Solve(const TPZFMatrix< TVar > &F, TPZFMatrix< TVar > &result, TPZFMatrix< TVar > *residual=0) override
Solves the system of linear equations.
Definition: pzmgsolver.cpp:32
Contains TPZSolver class which defines a abstract class of solvers which will be used by matrix class...
int ClassId() const override
Saveable specific methods.
Definition: pzmgsolver.h:69
TPZMatrixSolver< TVar > * fCoarse
Definition: pzmgsolver.h:61
Contains TPZStepSolver class which defines step solvers class.
int ClassId() const override
Saveable specific methods.
Definition: pzsolve.h:180
Defines the interface for saving and reading data. Persistency.
Definition: TPZStream.h:50
void ResetTransferMatrix()
Clean the transfer matrix.
Definition: pzmgsolver.cpp:71
void SetTransferMatrix(TPZAutoPointer< TPZMatrix< TVar > > Refmat)
Sets the transfer matrix.
Definition: pzmgsolver.cpp:77
TPZAutoPointer< TPZMatrix< TVar > > fTransfer
Transfer matrix.
Definition: pzmgsolver.h:64
void Read(TPZStream &buf, void *context) override
read objects from the stream
Definition: pzmgsolver.cpp:91
Root matrix class (abstract). Matrix.
Definition: pzmatrix.h:60
This class implements a reference counter mechanism to administer a dynamically allocated object...