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

Defines sequence solvers. Solver. More...

#include <pzseqsolver.h>

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

Public Member Functions

 TPZSequenceSolver (TPZMatrix< TVar > *refmat=0)
 Constructor with initialization parameter. More...
 
 TPZSequenceSolver (const TPZSequenceSolver< TVar > &copy)
 Copy constructor. More...
 
void Solve (const TPZFMatrix< TVar > &F, TPZFMatrix< TVar > &result, TPZFMatrix< TVar > *residual=0) override
 Solves the system of linear equations. More...
 
void ResetSolver ()
 This method will reinitialize the solver object, including the solution procedure. More...
 
virtual void ResetMatrix () override
 This method will reset the matrix associated with the solver. More...
 
virtual void UpdateFrom (TPZAutoPointer< TPZMatrix< TVar > > mat) override
 Updates the values of the preconditioner based on the values of the matrix. More...
 
void AppendSolver (TPZMatrixSolver< TVar > &solve)
 
virtual TPZSolver< TVar > * Clone () const override
 Clones the current object returning a pointer of type TPZSolver. 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...
 
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 ()
 
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 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

TPZStack< TPZMatrixSolver< TVar > *> fSolvers
 

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

Defines sequence solvers. Solver.

Definition at line 23 of file pzseqsolver.h.

Constructor & Destructor Documentation

◆ TPZSequenceSolver() [1/2]

template<class TVar >
TPZSequenceSolver< TVar >::TPZSequenceSolver ( TPZMatrix< TVar > *  refmat = 0)

Constructor with initialization parameter.

Parameters
refmatSets reference matrix to NILL

Definition at line 12 of file pzseqsolver.cpp.

Referenced by TPZSequenceSolver< TVar >::Clone().

◆ TPZSequenceSolver() [2/2]

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

Copy constructor.

Parameters
copyModel object to be copied from

Definition at line 17 of file pzseqsolver.cpp.

References TPZSequenceSolver< TVar >::AppendSolver(), TPZSequenceSolver< TVar >::fSolvers, TPZVec< T >::NElements(), and TPZMatrix< TVar >::s().

Member Function Documentation

◆ AppendSolver()

template<class TVar >
void TPZSequenceSolver< TVar >::AppendSolver ( TPZMatrixSolver< TVar > &  solve)

◆ ClassId()

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

Saveable specific methods.

Implements TPZSavable.

Definition at line 66 of file pzseqsolver.h.

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

◆ Clone()

template<class TVar >
TPZSolver< TVar > * TPZSequenceSolver< TVar >::Clone ( ) const
overridevirtual

Clones the current object returning a pointer of type TPZSolver.

Implements TPZSolver< TVar >.

Definition at line 25 of file pzseqsolver.cpp.

References TPZSequenceSolver< TVar >::TPZSequenceSolver().

Referenced by TPZMGAnalysis::AppendMesh().

◆ Read()

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

◆ ResetMatrix()

template<class TVar >
void TPZSequenceSolver< 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 TPZSolver< TVar >.

Definition at line 74 of file pzseqsolver.cpp.

References TPZSequenceSolver< TVar >::fSolvers, TPZVec< T >::NElements(), TPZMatrixSolver< TVar >::ResetMatrix(), and TPZMatrix< TVar >::s().

◆ ResetSolver()

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

This method will reinitialize the solver object, including the solution procedure.

Definition at line 35 of file pzseqsolver.cpp.

References TPZSequenceSolver< TVar >::fSolvers, TPZVec< T >::NElements(), TPZStack< T, NumExtAlloc >::Pop(), and TPZMatrix< TVar >::s().

◆ Solve()

template<class TVar >
void TPZSequenceSolver< 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 42 of file pzseqsolver.cpp.

References TPZMatrix< TVar >::Cols(), TPZMatrixSolver< TVar >::fScratch, TPZSequenceSolver< TVar >::fSolvers, TPZMatrixSolver< TVar >::Matrix(), TPZVec< T >::NElements(), TPZFMatrix< TVar >::Redim(), TPZMatrix< TVar >::Rows(), TPZMatrix< TVar >::s(), and TPZFMatrix< TVar >::Zero().

◆ UpdateFrom()

template<class TVar >
void TPZSequenceSolver< TVar >::UpdateFrom ( TPZAutoPointer< TPZMatrix< TVar > >  matrix)
overridevirtual

Updates the values of the preconditioner based on the values of the matrix.

Updates the values of the preconditioner based on the values of the matrix

Reimplemented from TPZMatrixSolver< TVar >.

Definition at line 88 of file pzseqsolver.cpp.

References TPZSequenceSolver< TVar >::fSolvers, matrix, TPZVec< T >::NElements(), TPZMatrix< TVar >::s(), and TPZMatrixSolver< TVar >::UpdateFrom().

◆ Write()

template<class TVar >
void TPZSequenceSolver< 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 TPZSavable.

Definition at line 99 of file pzseqsolver.cpp.

References TPZSequenceSolver< TVar >::fSolvers, TPZVec< T >::NElements(), TPZStream::Write(), TPZMatrixSolver< TVar >::Write(), and TPZPersistenceManager::WritePointer().

Member Data Documentation

◆ fSolvers

template<class TVar>
TPZStack< TPZMatrixSolver<TVar> * > TPZSequenceSolver< TVar >::fSolvers
private

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