15 static LoggerPtr logger(Logger::getLogger(
"pz.converge"));
67 cout <<
"TPZMatrixSolver::Solve called without a matrix pointer\n";
79 if(result.
Rows() != mat->Rows() || result.
Cols() != F.
Cols()) {
92 cout <<
"TPZMatrixSolver::Solve called without initialized solver, Jacobi used\n";
109 cout <<
"Number of equations " << mat->Rows() << std::endl;
110 cout <<
"Number of CG iterations " << numiterations <<
" tol = " << tol << endl;
114 if(logger->isDebugEnabled())
116 std::stringstream sout;
117 sout <<
"Number of equations " << mat->Rows() << std::endl;
118 sout <<
"Number of CG iterations " << numiterations <<
" tol = " <<
tol;
127 cout <<
"Number of GMRES iterations " << numiterations <<
" tol = " <<
tol;
130 std::cout <<
"GMRes tolerance was not achieved : numiter " << numiterations <<
131 " tol " << tol << endl;
135 std::stringstream sout;
136 sout <<
"Number of GMRES iterations " << numiterations <<
" tol = " <<
tol;
137 if(logger->isDebugEnabled())
LOGPZ_DEBUG(logger,sout.str().c_str());
148 std::cout <<
"BiCGStab tolerance was not achieved : numiter " << numiterations <<
149 " tol " << tol << endl;
153 std::stringstream sout;
154 sout <<
"Number of BiCGStab iterations " << numiterations <<
" tol = " <<
tol;
165 mat->Multiply(F,result);
166 if(residual) mat->Residual(result,F,*residual);
183 template <
class TVar>
189 template <
class TVar>
244 template <
class TVar>
264 template <
class TVar>
274 template <
class TVar>
279 buf.
Write(&lfSolver, 1);
289 std::list<int64_t>::const_iterator it =
fSingular.begin();
295 template <
class TVar>
302 buf.
Read(&lfSolver, 1);
315 std::list<int64_t>::iterator it =
fSingular.begin();
void SetSOR(const int64_t numiterations, const REAL overrelax, const REAL tol, const int64_t FromCurrent)
void ResetMatrix() override
Resets current object.
Contains definitions to LOGPZ_DEBUG, LOGPZ_INFO, LOGPZ_WARN, LOGPZ_ERROR and LOGPZ_FATAL, and the implementation of the inline InitializePZLOG(string) function using log4cxx library or not. It must to be called out of "#ifdef LOG4CXX" scope.
int ClassId() const override
Serialization methods.
void SetPreconditioner(TPZSolver< TVar > &solve)
Define the preconditioner as a solver object.
Defines a abstract class of solvers which will be used by matrix classes. Solver. ...
void Write(TPZStream &buf, int withclassid) const override
Writes this object to the TPZStream buffer. Include the classid if withclassid = true.
Defines step solvers class. Solver.
virtual void ResetMatrix() override
This method will reset the matrix associated with the solver.
Defines a class of matrix solvers. Solver.
static TPZSavable * GetInstance(const int64_t &objId)
void SetSSOR(const int64_t numiterations, const REAL overrelax, const REAL tol, const int64_t FromCurrent)
void Write(TPZStream &buf, int withclassid) const override
Writes this object to the TPZStream buffer. Include the classid if withclassid = true.
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)
virtual void Write(const bool val)
MSolver
Defines a series of solvers available in PZ.
virtual void Decompose() override
Decompose the system of equations if a direct solver is used.
#define DebugStop()
Returns a message to user put a breakpoint in.
#define LOGPZ_DEBUG(A, B)
Define log for debug info.
TPZMatrixSolver< TVar >::MSolver fSolver
void Read(TPZStream &buf, void *context) override
read objects from the stream
int64_t Rows() const
Returns number of rows.
void SetBiCGStab(const int64_t numiterations, const TPZMatrixSolver< TVar > &pre, const REAL tol, const int64_t FromCurrent)
TPZStepSolver(TPZAutoPointer< TPZMatrix< TVar > > refmat=0)
TPZFMatrix< TVar > fScratch
Manipulation matrix.
Full matrix class. Matrix.
int Redim(const int64_t newRows, const int64_t newCols) override
Redimension a matrix and ZERO your elements.
void Solve(const TPZFMatrix< TVar > &F, TPZFMatrix< TVar > &result, TPZFMatrix< TVar > *residual=0) override
Solves the system of linear equations.
virtual TPZSolver * Clone() const =0
Clones the current object returning a pointer of type TPZSolver.
int64_t fNumIterations
Number of iterations of last solve.
int64_t fMaxIterations
Maximum number of iterations.
TPZAutoPointer< TPZMatrix< TVar > > Matrix() const
Returns a pointer to TPZMatrix<>
TPZSolver< TVar > * fPrecond
Solver using preconditioner matrix.
Contains TPZStepSolver class which defines step solvers class.
int64_t Cols() const
Returns number of cols.
Defines the interface for saving and reading data. Persistency.
void Read(TPZStream &buf, void *context) override
read objects from the stream
void SetDirect(const DecomposeType decomp)
std::list< int64_t > fSingular
void ResetSolver()
reset the data structure of the solver object
static void WritePointer(const TPZSavable *obj, TPZStream *stream)
Implements an interface to register a class id and a restore function. Persistence.
DecomposeType
Defines decomposition type for any matrix classes.
void SetGMRES(const int64_t numiterations, const int numvectors, const TPZMatrixSolver< TVar > &pre, const REAL tol, const int64_t FromCurrent)
virtual void Read(bool &val)
Root matrix class (abstract). Matrix.
This class implements a reference counter mechanism to administer a dynamically allocated object...