NeoPZ
Public Member Functions | Private Attributes | List of all members
TPZMGSolver< TVar > Class Template Reference

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>

Inheritance diagram for TPZMGSolver< TVar >:
[legend]
Collaboration diagram for TPZMGSolver< TVar >:
[legend]

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)
 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 TPZSavableCreateInstance (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...
 

Detailed Description

template<class TVar>
class TPZMGSolver< TVar >

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.

Constructor & Destructor Documentation

◆ TPZMGSolver() [1/4]

template<class TVar>
TPZMGSolver< TVar >::TPZMGSolver ( )
inline

◆ TPZMGSolver() [2/4]

template<class TVar >
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() [3/4]

template<class TVar >
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() [4/4]

template<class TVar >
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()

template<class TVar >
TPZMGSolver< TVar >::~TPZMGSolver ( )

Default destructor.

Definition at line 66 of file pzmgsolver.cpp.

References TPZMGSolver< TVar >::fCoarse.

Referenced by TPZMGSolver< TVar >::TPZMGSolver().

Member Function Documentation

◆ ClassId()

template<class TVar >
int TPZMGSolver< TVar >::ClassId ( ) const
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().

◆ Clone()

template<class TVar >
TPZSolver< TVar > * TPZMGSolver< TVar >::Clone ( ) const
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().

◆ Read()

template<class TVar >
void TPZMGSolver< TVar >::Read ( TPZStream buf,
void *  context 
)
overridevirtual

◆ ResetTransferMatrix()

template<class TVar >
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().

◆ SetTransferMatrix()

template<class TVar >
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().

◆ Solve()

template<class TVar >
void TPZMGSolver< TVar >::Solve ( const TPZFMatrix< TVar > &  F,
TPZFMatrix< TVar > &  result,
TPZFMatrix< TVar > *  residual = 0 
)
overridevirtual

Solves the system of linear equations.

Parameters
Fcontains Force vector
resultcontains the solution
residualcontains 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().

◆ TransferMatrix()

template<class TVar>
TPZAutoPointer<TPZMatrix<TVar> > TPZMGSolver< TVar >::TransferMatrix ( )
inline

◆ Write()

template<class TVar >
void TPZMGSolver< TVar >::Write ( TPZStream buf,
int  withclassid 
) const
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().

Member Data Documentation

◆ fCoarse

template<class TVar>
TPZMatrixSolver<TVar>* TPZMGSolver< TVar >::fCoarse
private

◆ fNVar

template<class TVar>
int TPZMGSolver< TVar >::fNVar
private

◆ fTransfer

template<class TVar>
TPZAutoPointer<TPZMatrix<TVar> > TPZMGSolver< TVar >::fTransfer
private

The documentation for this class was generated from the following files: