34 cout <<
"TPZMGSolver::Solve called without a matrix pointer\n";
38 if(result.
Rows() != tr->Cols() || result.
Cols() != F.
Cols()) {
43 tr->Multiply(F,FCoarse,0);
44 double norm =
Norm(FCoarse);
47 fCoarse->Solve(FCoarse,UCoarse);
49 tr->Multiply(UCoarse,result,1);
50 if(residual) this->
Matrix()->Residual(F,result,*residual);
Contains the TPZMGSolver class which represents a solution process in three steps.
~TPZMGSolver()
Default destructor.
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.
TPZSolver< TVar > * Clone() const override
Clones the current object returning a pointer of type TPZSolver.
Defines a class of matrix solvers. Solver.
TPZAutoPointer< TPZMatrix< TVar > > TransferMatrix()
Gets the transfer matrix.
static TPZSavable * GetInstance(const int64_t &objId)
Contains the TPZTransfer class which implements a rectangular sparse block matrix.
static TPZAutoPointer< TPZSavable > GetAutoPointer(const int64_t &objId)
virtual void Write(const bool val)
TVar Norm(const TPZFMatrix< TVar > &A)
Returns the norm of the matrix A.
#define DebugStop()
Returns a message to user put a breakpoint in.
TPZMGSolver()
Default constructor.
void Read(TPZStream &buf, void *context) override
read objects from the stream
int64_t Rows() const
Returns number of rows.
Represents a solution process in three steps: transfer of the residual, execute a solver on the coars...
Full matrix class. Matrix.
int Redim(const int64_t newRows, const int64_t newCols) override
Redimension a matrix and ZERO your elements.
void Write(TPZStream &buf, int withclassid) const override
Writes this object to the TPZStream buffer. Include the classid if withclassid = true.
virtual TPZSolver * Clone() const =0
Clones the current object returning a pointer of type TPZSolver.
void Solve(const TPZFMatrix< TVar > &F, TPZFMatrix< TVar > &result, TPZFMatrix< TVar > *residual=0) override
Solves the system of linear equations.
TPZAutoPointer< TPZMatrix< TVar > > Matrix() const
Returns a pointer to TPZMatrix<>
int ClassId() const override
Saveable specific methods.
TPZMatrixSolver< TVar > * fCoarse
int64_t Cols() const
Returns number of cols.
Defines the interface for saving and reading data. Persistency.
void ResetTransferMatrix()
Clean the transfer matrix.
void SetTransferMatrix(TPZAutoPointer< TPZMatrix< TVar > > Refmat)
Sets the transfer matrix.
static void WritePointer(const TPZSavable *obj, TPZStream *stream)
TPZAutoPointer< TPZMatrix< TVar > > fTransfer
Transfer matrix.
Implements an interface to register a class id and a restore function. Persistence.
void Read(TPZStream &buf, void *context) override
read objects from the stream
virtual void Read(bool &val)
Root matrix class (abstract). Matrix.
This class implements a reference counter mechanism to administer a dynamically allocated object...