NeoPZ
|
Defines sequence solvers. Solver. More...
#include <pzseqsolver.h>
Public Member Functions | |
TPZSequenceSolver (TPZMatrix< TVar > *refmat=0) | |
Constructor with initialization parameter. More... | |
TPZSequenceSolver (const TPZSequenceSolver< TVar > ©) | |
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 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... | |
Defines sequence solvers. Solver.
Definition at line 23 of file pzseqsolver.h.
TPZSequenceSolver< TVar >::TPZSequenceSolver | ( | TPZMatrix< TVar > * | refmat = 0 | ) |
Constructor with initialization parameter.
refmat | Sets reference matrix to NILL |
Definition at line 12 of file pzseqsolver.cpp.
Referenced by TPZSequenceSolver< TVar >::Clone().
TPZSequenceSolver< TVar >::TPZSequenceSolver | ( | const TPZSequenceSolver< TVar > & | copy | ) |
Copy constructor.
copy | Model 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().
void TPZSequenceSolver< TVar >::AppendSolver | ( | TPZMatrixSolver< TVar > & | solve | ) |
Definition at line 30 of file pzseqsolver.cpp.
References TPZSolver< TVar >::Clone(), TPZSequenceSolver< TVar >::fSolvers, and TPZStack< T, NumExtAlloc >::Push().
Referenced by TPZMGAnalysis::AppendMesh(), TPZAnalysis::BuildSequenceSolver(), and TPZSequenceSolver< TVar >::TPZSequenceSolver().
|
overridevirtual |
Saveable specific methods.
Implements TPZSavable.
Definition at line 66 of file pzseqsolver.h.
References TPZMatrixSolver< TVar >::ClassId(), and Hash().
|
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().
|
overridevirtual |
read objects from the stream
Reimplemented from TPZSavable.
Definition at line 112 of file pzseqsolver.cpp.
References TPZSequenceSolver< TVar >::fSolvers, TPZPersistenceManager::GetInstance(), TPZStream::Read(), TPZMatrixSolver< TVar >::Read(), and TPZManVector< T, NumExtAlloc >::Resize().
|
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().
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().
|
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 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().
|
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().
|
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().
|
private |
Definition at line 62 of file pzseqsolver.h.
Referenced by TPZSequenceSolver< TVar >::AppendSolver(), TPZSequenceSolver< TVar >::Read(), TPZSequenceSolver< TVar >::ResetMatrix(), TPZSequenceSolver< TVar >::ResetSolver(), TPZSequenceSolver< TVar >::Solve(), TPZSequenceSolver< TVar >::TPZSequenceSolver(), TPZSequenceSolver< TVar >::UpdateFrom(), and TPZSequenceSolver< TVar >::Write().