39 #ifndef __SOLVERAZTECOO_H 40 #define __SOLVERAZTECOO_H 1
45 #include <Epetra_ConfigDefs.h> 47 #include <Epetra_MpiComm.h> 49 #include <Epetra_SerialComm.h> 52 #include <AztecOO_ConfigDefs.h> 54 #include <Teuchos_ParameterList.hpp> 57 #include <lifev/core/LifeV.hpp> 59 #include <lifev/core/array/VectorEpetra.hpp> 60 #include <lifev/core/array/MatrixEpetra.hpp> 61 #include <lifev/core/algorithm/Preconditioner.hpp> 62 #include <lifev/core/algorithm/PreconditionerIfpack.hpp> 63 #include <lifev/core/util/LifeDebug.hpp> 64 #include <lifev/core/filter/GetPot.hpp> 65 #include <lifev/core/util/LifeChrono.hpp> 66 #include <lifev/core/util/Displayer.hpp> 110 LIFEV_DEPRECATED ( SolverAztecOO (
const std::shared_ptr<Epetra_Comm>& comm ) );
162 template <
typename PrecPtrOperator>
165 PrecPtrOperator preconditionerPtr );
172 void setupPreconditioner (
const GetPot& dataFile,
const std::string& section );
189 void showMe ( std::ostream& output = std::cout )
const;
230 void setDataFromGetPot (
const GetPot& dataFile,
const std::string& section );
304 template <
typename PrecPtrOperator>
307 PrecPtrOperator preconditioner )
310 M_displayer->leaderPrint (
"SLV- AztecOO solving system ... ");
317 M_displayer->leaderPrintMax (
"done in " , chrono.diff() );
320 if ( M_TrilinosParameterList.get (
"output",
"all" ) ==
"none" )
322 M_displayer->leaderPrint (
"SLV- Iterations number: ", M_solver.NumIters(),
"\n" );
323 M_displayer->leaderPrint (
"SLV- Scaled residual: ", M_solver.ScaledResidual(),
"\n" );
prec_type M_preconditioner
VectorEpetra - The Epetra Vector format Wrapper.
Real computeResidual(vector_type &solution, vector_type &rhs)
Compute the residual.
std::string printStatus()
return the Aztec status
void start()
Start the timer.
std::shared_ptr< prec_raw_type > prec_type
Real trueResidual()
Return the true residual.
SolverAztecOO - Class to wrap linear solver.
Int numIterations() const
Return the total number of iterations.
void setMaxNumIterations(const Int maxIter=-1)
Set the tolerance and the maximum number of iterations.
void importFromHDF5(std::string const &fileName, std::string const &matrixName="matrix")
Read a matrix from a HDF5 (.h5) file.
Teuchos::ParameterList M_TrilinosParameterList
Int solve(vector_type &solution, const vector_type &rhs)
Solve the problem .
void showMe(std::ostream &output=std::cout) const
Print informations about the solver.
int32_type Int
Generic integer data.
void aztecStatus(Real status[AZ_STATUS_SIZE])
Return the AztecStatus.
void updateInverseJacobian(const UInt &iQuadPt)
void setOperator(Epetra_Operator &oper)
Method to set a general linear operator (of class derived from Epetra_Operator) defining the linear s...
void setReusePreconditioner(const bool reusePreconditioner)
Specify if the preconditioner should be reuse or not.
std::shared_ptr< Displayer > M_displayer
bool M_reusePreconditioner
Teuchos::ParameterList & getParametersList()
Return a Teuchos parameters list.
void setCommunicator(const std::shared_ptr< Epetra_Comm > &comm)
Method to set communicator for Displayer (for empty constructor)
std::shared_ptr< Epetra_Operator > comp_prec_type
AztecOO & solver()
Return a reference on the AztecOO solver.
SolverAztecOO solver_type
bool isPreconditionerSet() const
Return true if preconditioner has been setted.
Int solveSystem(const vector_type &rhsFull, vector_type &solution, PrecPtrOperator preconditionerPtr)
Solves the system and returns the number of iterations.
prec_type & preconditioner()
Method to get a shared pointer to the preconditioner (of type derived from Preconditioner)*/.
Preconditioner prec_raw_type
void buildPreconditioner(matrix_ptrtype &baseMatrixForPreconditioner)
Builds the preconditioner starting from the matrix "baseMatrixForPreconditioner". ...
double Real
Generic real data.
std::shared_ptr< VectorEpetra > vector_ptrtype
Preconditioner - Abstract preconditioner class.
Int maxNumIterations() const
Return the maximum total number of iterations.
matrix_type::matrix_ptrtype M_matrix
void stop()
Stop the timer.
std::shared_ptr< matrix_type > matrix_ptrtype
void setParameters(bool cerrWarningIfUnused=false)
Set the current parameters with the internal parameters list.
#define LIFEV_DEPRECATED(func)
void resetPreconditioner()
Delete the stored preconditioner.
std::shared_ptr< Displayer > displayer()
Return the displayer.
void setTolerance(const Real tolerance)
Set the tolerance of the solver.
MatrixEpetra< Real > matrix_type
void setMatrix(matrix_type &matrix)
Method to set matrix from MatrixEpetra.
Int solveSystem(const vector_type &rhsFull, vector_type &solution, matrix_ptrtype &baseMatrixForPreconditioner)
Solves the system and returns the number of iterations.
void setPreconditioner(comp_prec_type &preconditioner)
Method to set a general Epetra_Operator as preconditioner.