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

Defines step solvers class. Solver. More...

#include <pzmganalysis.h>

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

Public Member Functions

 TPZStepSolver (TPZAutoPointer< TPZMatrix< TVar > > refmat=0)
 
 TPZStepSolver (const TPZStepSolver< TVar > &copy)
 
virtual ~TPZStepSolver ()
 
void SetSOR (const int64_t numiterations, const REAL overrelax, const REAL tol, const int64_t FromCurrent)
 
void SetSSOR (const int64_t numiterations, const REAL overrelax, const REAL tol, const int64_t FromCurrent)
 
void SetJacobi (const int64_t numiterations, const REAL tol, const int64_t FromCurrent)
 
void SetCG (const int64_t numiterations, const TPZMatrixSolver< TVar > &pre, const REAL tol, const int64_t FromCurrent)
 
void SetGMRES (const int64_t numiterations, const int numvectors, const TPZMatrixSolver< TVar > &pre, const REAL tol, const int64_t FromCurrent)
 
void SetBiCGStab (const int64_t numiterations, const TPZMatrixSolver< TVar > &pre, const REAL tol, const int64_t FromCurrent)
 
void SetDirect (const DecomposeType decomp)
 
void SetMultiply ()
 
virtual TPZSolver< TVar > * Clone () const override
 Clones the current object returning a pointer of type TPZSolver. More...
 
void SetTolerance (REAL tol)
 
REAL GetTolerance () const
 return the value of tolerance from the solver More...
 
void ResetSolver ()
 reset the data structure of the solver object More...
 
virtual TPZMatrixSolver< TVar >::MSolver Solver () override
 
std::list< int64_t > & Singular ()
 returns the equations for which the equations had zero pivot More...
 
virtual void ResetMatrix () override
 This method will reset the matrix associated with the solver. 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 Solve (const TPZFMatrix< TVar > &F, TPZFMatrix< TVar > &result, TPZFMatrix< TVar > *residual=0) override
 Solves the system of linear equations. More...
 
virtual void Decompose () override
 Decompose the system of equations if a direct solver is used. More...
 
void SetPreconditioner (TPZSolver< TVar > &solve)
 Define the preconditioner as a solver object. More...
 
int NumIterations ()
 Number of iterations of last solve. More...
 
TPZSolver< TVar > * PreConditioner ()
 access method to the preconditioner More...
 
int ClassId () const override
 Serialization 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 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...
 
- Public Member Functions inherited from TPZSolver< TVar >
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 >::MSolver fSolver
 
DecomposeType fDecompose
 
int64_t fMaxIterations
 Maximum number of iterations. More...
 
int64_t fNumIterations
 Number of iterations of last solve. More...
 
int fNumVectors
 
REAL fTol
 
REAL fOverRelax
 
TPZSolver< TVar > * fPrecond
 Solver using preconditioner matrix. More...
 
int64_t fFromCurrent
 
std::list< int64_t > fSingular
 

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 TPZStepSolver< TVar >

Defines step solvers class. Solver.

Definition at line 17 of file pzmganalysis.h.

Constructor & Destructor Documentation

◆ TPZStepSolver() [1/2]

template<class TVar >
TPZStepSolver< TVar >::TPZStepSolver ( TPZAutoPointer< TPZMatrix< TVar > >  refmat = 0)

◆ TPZStepSolver() [2/2]

template<class TVar >
TPZStepSolver< TVar >::TPZStepSolver ( const TPZStepSolver< TVar > &  copy)

◆ ~TPZStepSolver()

template<class TVar >
TPZStepSolver< TVar >::~TPZStepSolver ( )
virtual

Definition at line 39 of file pzstepsolver.cpp.

References TPZStepSolver< TVar >::fPrecond.

Member Function Documentation

◆ ClassId()

template<class TVar >
int TPZStepSolver< TVar >::ClassId ( ) const
overridevirtual

Serialization methods.

Reimplemented from TPZMatrixSolver< TVar >.

Definition at line 138 of file pzstepsolver.h.

References TPZMatrixSolver< TVar >::ClassId(), and Hash().

Referenced by TPZStepSolver< TVar >::PreConditioner().

◆ Clone()

template<class TVar>
virtual TPZSolver<TVar>* TPZStepSolver< TVar >::Clone ( ) const
inlineoverridevirtual

Clones the current object returning a pointer of type TPZSolver.

Implements TPZSolver< TVar >.

Definition at line 46 of file pzstepsolver.h.

Referenced by TPZMGAnalysis::AppendMesh(), TPZNonLinMultGridAnalysis::TPZNonLinMultGridAnalysis(), and TPZNonLinMultGridAnalysis::TwoGridAlgorithm().

◆ Decompose()

template<class TVar >
void TPZStepSolver< TVar >::Decompose ( )
overridevirtual

◆ GetTolerance()

template<class TVar>
REAL TPZStepSolver< TVar >::GetTolerance ( ) const
inline

return the value of tolerance from the solver

Definition at line 57 of file pzstepsolver.h.

References TPZStepSolver< TVar >::fTol, and TPZStepSolver< TVar >::ResetSolver().

Referenced by main().

◆ NumIterations()

template<class TVar>
int TPZStepSolver< TVar >::NumIterations ( )
inline

Number of iterations of last solve.

Definition at line 98 of file pzstepsolver.h.

References TPZStepSolver< TVar >::fNumIterations.

Referenced by main().

◆ PreConditioner()

template<class TVar>
TPZSolver<TVar>* TPZStepSolver< TVar >::PreConditioner ( )
inline

◆ Read()

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

◆ ResetMatrix()

template<class TVar >
void TPZStepSolver< TVar >::ResetMatrix ( )
overridevirtual

This method will reset the matrix associated with the solver.

This is useful when the matrix needs to be recomputed in a non linear problem

This method will reset the matrix associated with the solver
This is useful when the matrix needs to be recomputed in a non linear problem

Reimplemented from TPZMatrixSolver< TVar >.

Definition at line 48 of file pzstepsolver.cpp.

References TPZMatrixSolver< TVar >::ResetMatrix().

Referenced by TPZStepSolver< TVar >::Singular().

◆ ResetSolver()

template<class TVar >
void TPZStepSolver< TVar >::ResetSolver ( )

◆ SetBiCGStab()

template<class TVar >
void TPZStepSolver< TVar >::SetBiCGStab ( const int64_t  numiterations,
const TPZMatrixSolver< TVar > &  pre,
const REAL  tol,
const int64_t  FromCurrent 
)

◆ SetCG()

template<class TVar >
void TPZStepSolver< TVar >::SetCG ( const int64_t  numiterations,
const TPZMatrixSolver< TVar > &  pre,
const REAL  tol,
const int64_t  FromCurrent 
)

◆ SetDirect()

template<class TVar >
void TPZStepSolver< TVar >::SetDirect ( const DecomposeType  decomp)

◆ SetGMRES()

template<class TVar >
void TPZStepSolver< TVar >::SetGMRES ( const int64_t  numiterations,
const int  numvectors,
const TPZMatrixSolver< TVar > &  pre,
const REAL  tol,
const int64_t  FromCurrent 
)

◆ SetJacobi()

template<class TVar >
void TPZStepSolver< TVar >::SetJacobi ( const int64_t  numiterations,
const REAL  tol,
const int64_t  FromCurrent 
)

◆ SetMultiply()

template<class TVar >
void TPZStepSolver< TVar >::SetMultiply ( )

◆ SetPreconditioner()

template<class TVar >
void TPZStepSolver< TVar >::SetPreconditioner ( TPZSolver< TVar > &  solve)

◆ SetSOR()

template<class TVar >
void TPZStepSolver< TVar >::SetSOR ( const int64_t  numiterations,
const REAL  overrelax,
const REAL  tol,
const int64_t  FromCurrent 
)

◆ SetSSOR()

template<class TVar >
void TPZStepSolver< TVar >::SetSSOR ( const int64_t  numiterations,
const REAL  overrelax,
const REAL  tol,
const int64_t  FromCurrent 
)

◆ SetTolerance()

template<class TVar>
void TPZStepSolver< TVar >::SetTolerance ( REAL  tol)
inline

Definition at line 51 of file pzstepsolver.h.

References TPZStepSolver< TVar >::fTol, and pzgeom::tol.

Referenced by TPZMGAnalysis::Solve().

◆ Singular()

template<class TVar>
std::list<int64_t>& TPZStepSolver< TVar >::Singular ( )
inline

◆ Solve()

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

◆ Solver()

template<class TVar>
virtual TPZMatrixSolver<TVar>::MSolver TPZStepSolver< TVar >::Solver ( )
inlineoverridevirtual

◆ UpdateFrom()

template<class TVar>
virtual void TPZStepSolver< TVar >::UpdateFrom ( TPZAutoPointer< TPZMatrix< TVar > >  matrix)
inlineoverridevirtual

◆ Write()

template<class TVar >
void TPZStepSolver< TVar >::Write ( TPZStream buf,
int  withclassid 
) const
overridevirtual

Member Data Documentation

◆ fDecompose

template<class TVar>
DecomposeType TPZStepSolver< TVar >::fDecompose
private

◆ fFromCurrent

template<class TVar>
int64_t TPZStepSolver< TVar >::fFromCurrent
private

◆ fMaxIterations

template<class TVar>
int64_t TPZStepSolver< TVar >::fMaxIterations
private

◆ fNumIterations

template<class TVar>
int64_t TPZStepSolver< TVar >::fNumIterations
private

◆ fNumVectors

template<class TVar>
int TPZStepSolver< TVar >::fNumVectors
private

◆ fOverRelax

template<class TVar>
REAL TPZStepSolver< TVar >::fOverRelax
private

◆ fPrecond

template<class TVar>
TPZSolver<TVar>* TPZStepSolver< TVar >::fPrecond
private

◆ fSingular

template<class TVar>
std::list<int64_t> TPZStepSolver< TVar >::fSingular
private

◆ fSolver

template<class TVar>
TPZMatrixSolver<TVar>::MSolver TPZStepSolver< TVar >::fSolver
private

◆ fTol

template<class TVar>
REAL TPZStepSolver< TVar >::fTol
private

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