NeoPZ
|
Represents a solution process in three steps: transfer of the residual, execute a solver on the coarse mesh, extend the solution. Solver. More...
#include <pzmgsolver.h>
Public Member Functions | |
TPZMGSolver () | |
Default constructor. More... | |
TPZMGSolver (TPZAutoPointer< TPZMatrix< TVar > > trf, const TPZMatrixSolver< TVar > &sol, int nvar, TPZAutoPointer< TPZMatrix< TVar > > refmat) | |
Constructor of the three steps solver with transfer matrix. More... | |
TPZMGSolver (TPZAutoPointer< TPZMatrix< TVar > > trf, const TPZMatrixSolver< TVar > &sol, int nvar) | |
Constructor of the three steps solver. More... | |
TPZMGSolver (const TPZMGSolver< TVar > ©) | |
Copy constructor. More... | |
~TPZMGSolver () | |
Default destructor. More... | |
void | SetTransferMatrix (TPZAutoPointer< TPZMatrix< TVar > > Refmat) |
Sets the transfer matrix. More... | |
void | ResetTransferMatrix () |
Clean the transfer matrix. More... | |
TPZAutoPointer< TPZMatrix< TVar > > | TransferMatrix () |
Gets the transfer matrix. More... | |
TPZSolver< TVar > * | Clone () const override |
Clones the current object returning a pointer of type TPZSolver. More... | |
void | Solve (const TPZFMatrix< TVar > &F, TPZFMatrix< TVar > &result, TPZFMatrix< TVar > *residual=0) override |
Solves the system of linear equations. More... | |
int | ClassId () const override |
Saveable specific methods. More... | |
void | Write (TPZStream &buf, int withclassid) const override |
Writes this object to the TPZStream buffer. Include the classid if withclassid = true. More... | |
void | Read (TPZStream &buf, void *context) override |
read objects from the stream More... | |
Public Member Functions inherited from TPZMatrixSolver< TVar > | |
TPZMatrixSolver (TPZAutoPointer< TPZMatrix< TVar > > Refmat) | |
Constructor with initialization parameter. More... | |
TPZMatrixSolver () | |
TPZMatrixSolver (const TPZMatrixSolver< TVar > &Source) | |
Copy constructor. More... | |
virtual | ~TPZMatrixSolver () |
Destructor. More... | |
virtual void | SetMatrix (TPZAutoPointer< TPZMatrix< TVar > > Refmat) |
Sets a matrix to the current object. More... | |
virtual void | UpdateFrom (TPZAutoPointer< TPZMatrix< TVar > > matrix) override |
Updates the values of the current matrix based on the values of the matrix. More... | |
void | ResetMatrix () override |
Resets current object. More... | |
virtual void | SetReferenceMatrix (TPZAutoPointer< TPZMatrix< TVar > > matrix) |
This method gives a preconditioner to share a matrix with the referring solver object. More... | |
TPZAutoPointer< TPZMatrix< TVar > > | Matrix () const |
Returns a pointer to TPZMatrix<> More... | |
void | ReallocMatrix () |
void | ShareMatrix (TPZMatrixSolver< TVar > &other) |
Shares the current matrix with another object of same type. More... | |
virtual MSolver | Solver () |
Public Member Functions inherited from TPZSolver< TVar > | |
virtual void | Decompose () |
Decompose the system of equations if a direct solver is used. More... | |
virtual | ~TPZSolver () |
Destructor. More... | |
Public Member Functions inherited from TPZSavable | |
TPZSavable () | |
virtual | ~TPZSavable () |
virtual std::list< std::map< std::string, uint64_t > > | VersionHistory () const |
virtual std::pair< std::string, uint64_t > | Version () const |
virtual bool | Compare (TPZSavable *copy, bool override=false) |
Compares the object for identity with the object pointed to, eventually copy the object. More... | |
virtual bool | Compare (TPZSavable *copy, bool override=false) const |
Compares the object for identity with the object pointed to, eventually copy the object. More... | |
Public Member Functions inherited from TPZRegisterClassId | |
template<typename T > | |
TPZRegisterClassId (int(T::*)() const) | |
TPZRegisterClassId ()=default | |
Private Attributes | |
TPZMatrixSolver< TVar > * | fCoarse |
int | fNVar |
TPZAutoPointer< TPZMatrix< TVar > > | fTransfer |
Transfer matrix. More... | |
Additional Inherited Members | |
Public Types inherited from TPZMatrixSolver< TVar > | |
enum | MSolver { ENoSolver, EJacobi, ESOR, ESSOR, ECG, EGMRES, EBICGSTAB, EDirect, EMultiply } |
Defines a series of solvers available in PZ. More... | |
Static Public Member Functions inherited from TPZSavable | |
static std::set< TPZRestoreClassBase * > & | RestoreClassSet () |
This static function guarantees that the gMap object is available when needed. More... | |
static std::map< int, TPZRestore_t > & | ClassIdMap () |
This static function guarantees that the gMap object is available when needed. More... | |
static std::pair< std::string, uint64_t > | NeoPZVersion () |
static void | Register (TPZRestoreClassBase *restore) |
static void | RegisterClassId (int classid, TPZRestore_t fun) |
static TPZSavable * | CreateInstance (const int &classId) |
Protected Attributes inherited from TPZMatrixSolver< TVar > | |
TPZAutoPointer< TPZMatrix< TVar > > | fReferenceMatrix |
Reference matrix used to update the current matrix. More... | |
TPZFMatrix< TVar > | fScratch |
Manipulation matrix. More... | |
Represents a solution process in three steps: transfer of the residual, execute a solver on the coarse mesh, extend the solution. Solver.
Definition at line 21 of file pzmgsolver.h.
|
inline |
Default constructor.
Definition at line 25 of file pzmgsolver.h.
References TPZMGSolver< TVar >::ResetTransferMatrix(), TPZMGSolver< TVar >::SetTransferMatrix(), and TPZMGSolver< TVar >::~TPZMGSolver().
TPZMGSolver< TVar >::TPZMGSolver | ( | TPZAutoPointer< TPZMatrix< TVar > > | trf, |
const TPZMatrixSolver< TVar > & | sol, | ||
int | nvar, | ||
TPZAutoPointer< TPZMatrix< TVar > > | refmat | ||
) |
Constructor of the three steps solver with transfer matrix.
Definition at line 13 of file pzmgsolver.cpp.
References TPZSolver< TVar >::Clone(), TPZMGSolver< TVar >::fCoarse, and TPZMGSolver< TVar >::fNVar.
TPZMGSolver< TVar >::TPZMGSolver | ( | TPZAutoPointer< TPZMatrix< TVar > > | trf, |
const TPZMatrixSolver< TVar > & | sol, | ||
int | nvar | ||
) |
Constructor of the three steps solver.
Definition at line 22 of file pzmgsolver.cpp.
References TPZSolver< TVar >::Clone(), TPZMGSolver< TVar >::fCoarse, and TPZMGSolver< TVar >::fNVar.
TPZMGSolver< TVar >::TPZMGSolver | ( | const TPZMGSolver< TVar > & | copy | ) |
Copy constructor.
Definition at line 54 of file pzmgsolver.cpp.
References TPZMGSolver< TVar >::fCoarse, and TPZMGSolver< TVar >::fNVar.
TPZMGSolver< TVar >::~TPZMGSolver | ( | ) |
Default destructor.
Definition at line 66 of file pzmgsolver.cpp.
References TPZMGSolver< TVar >::fCoarse.
Referenced by TPZMGSolver< TVar >::TPZMGSolver().
|
overridevirtual |
Saveable specific methods.
Reimplemented from TPZMatrixSolver< TVar >.
Definition at line 69 of file pzmgsolver.h.
References TPZMatrixSolver< TVar >::ClassId(), and Hash().
Referenced by TPZMGSolver< TVar >::TransferMatrix().
|
overridevirtual |
Clones the current object returning a pointer of type TPZSolver.
Implements TPZSolver< TVar >.
Definition at line 61 of file pzmgsolver.cpp.
Referenced by TPZMGSolver< TVar >::TransferMatrix().
|
overridevirtual |
read objects from the stream
Reimplemented from TPZMatrixSolver< TVar >.
Definition at line 91 of file pzmgsolver.cpp.
References TPZMGSolver< TVar >::fCoarse, TPZMGSolver< TVar >::fNVar, TPZMGSolver< TVar >::fTransfer, TPZPersistenceManager::GetAutoPointer(), TPZPersistenceManager::GetInstance(), TPZStream::Read(), and TPZMatrixSolver< TVar >::Read().
Referenced by TPZMGSolver< TVar >::TransferMatrix().
void TPZMGSolver< TVar >::ResetTransferMatrix | ( | ) |
Clean the transfer matrix.
Definition at line 71 of file pzmgsolver.cpp.
References TPZMGSolver< TVar >::fTransfer.
Referenced by TPZMGSolver< TVar >::TPZMGSolver().
void TPZMGSolver< TVar >::SetTransferMatrix | ( | TPZAutoPointer< TPZMatrix< TVar > > | Refmat | ) |
Sets the transfer matrix.
Definition at line 77 of file pzmgsolver.cpp.
References TPZMGSolver< TVar >::fTransfer.
Referenced by TPZMGSolver< TVar >::TPZMGSolver().
|
overridevirtual |
Solves the system of linear equations.
F | contains Force vector |
result | contains the solution |
residual | contains the residual for that linear system |
Implements TPZSolver< TVar >.
Definition at line 32 of file pzmgsolver.cpp.
References TPZMatrix< TVar >::Cols(), DebugStop, TPZMGSolver< TVar >::fCoarse, TPZMatrixSolver< TVar >::Matrix(), Norm(), TPZFMatrix< TVar >::Redim(), TPZMatrix< TVar >::Rows(), and TPZMGSolver< TVar >::TransferMatrix().
Referenced by TPZMGSolver< TVar >::TransferMatrix().
|
inline |
Gets the transfer matrix.
Definition at line 44 of file pzmgsolver.h.
References TPZMGSolver< TVar >::ClassId(), TPZMGSolver< TVar >::Clone(), TPZMGSolver< TVar >::fTransfer, TPZMGSolver< TVar >::Read(), TPZMGSolver< TVar >::Solve(), and TPZMGSolver< TVar >::Write().
Referenced by TPZMGSolver< TVar >::Solve().
|
overridevirtual |
Writes this object to the TPZStream buffer. Include the classid if withclassid = true.
Writes this object to the TPZStream buffer. Include the classid if withclassid = true
Reimplemented from TPZMatrixSolver< TVar >.
Definition at line 82 of file pzmgsolver.cpp.
References TPZMGSolver< TVar >::fCoarse, TPZMGSolver< TVar >::fNVar, TPZMGSolver< TVar >::fTransfer, TPZStream::Write(), TPZMatrixSolver< TVar >::Write(), and TPZPersistenceManager::WritePointer().
Referenced by TPZMGSolver< TVar >::TransferMatrix().
|
private |
Definition at line 61 of file pzmgsolver.h.
Referenced by TPZMGSolver< TVar >::Read(), TPZMGSolver< TVar >::Solve(), TPZMGSolver< TVar >::TPZMGSolver(), TPZMGSolver< TVar >::Write(), and TPZMGSolver< TVar >::~TPZMGSolver().
|
private |
Definition at line 62 of file pzmgsolver.h.
Referenced by TPZMGSolver< TVar >::Read(), TPZMGSolver< TVar >::TPZMGSolver(), and TPZMGSolver< TVar >::Write().
|
private |
Transfer matrix.
Definition at line 64 of file pzmgsolver.h.
Referenced by TPZMGSolver< TVar >::Read(), TPZMGSolver< TVar >::ResetTransferMatrix(), TPZMGSolver< TVar >::SetTransferMatrix(), TPZMGSolver< TVar >::TransferMatrix(), and TPZMGSolver< TVar >::Write().