![]() |
LifeV
|
SolverAztecOO - Class to wrap linear solver. More...
#include <SolverAztecOO.hpp>
Private Attributes | |
matrix_type::matrix_ptrtype | M_matrix |
prec_type | M_preconditioner |
AztecOO | M_solver |
Teuchos::ParameterList | M_TrilinosParameterList |
std::shared_ptr< Displayer > | M_displayer |
Real | M_tolerance |
Int | M_maxIter |
Int | M_maxIterForReuse |
bool | M_reusePreconditioner |
Public Types | |
typedef Real | value_type |
typedef SolverAztecOO | solver_type |
typedef MatrixEpetra< Real > | matrix_type |
typedef VectorEpetra | vector_type |
typedef Preconditioner | prec_raw_type |
typedef std::shared_ptr< prec_raw_type > | prec_type |
typedef std::shared_ptr< Epetra_Operator > | comp_prec_type |
typedef std::shared_ptr< matrix_type > | matrix_ptrtype |
typedef std::shared_ptr< VectorEpetra > | vector_ptrtype |
Constructors & Destructor | |
LIFEV_DEPRECATED (SolverAztecOO()) | |
Empty constructor. More... | |
LIFEV_DEPRECATED (SolverAztecOO(const std::shared_ptr< Epetra_Comm > &comm)) | |
Constructor. More... | |
Methods | |
Int | solve (vector_type &solution, const vector_type &rhs) |
Solve the problem ![]() | |
Real | computeResidual (vector_type &solution, vector_type &rhs) |
Compute the residual. More... | |
std::string | printStatus () |
return the Aztec status More... | |
Int | solveSystem (const vector_type &rhsFull, vector_type &solution, matrix_ptrtype &baseMatrixForPreconditioner) |
Solves the system and returns the number of iterations. More... | |
template<typename PrecPtrOperator > | |
Int | solveSystem (const vector_type &rhsFull, vector_type &solution, PrecPtrOperator preconditionerPtr) |
Solves the system and returns the number of iterations. More... | |
void | setupPreconditioner (const GetPot &dataFile, const std::string §ion) |
Setup the preconditioner. More... | |
void | buildPreconditioner (matrix_ptrtype &baseMatrixForPreconditioner) |
Builds the preconditioner starting from the matrix "baseMatrixForPreconditioner". More... | |
void | resetPreconditioner () |
Delete the stored preconditioner. More... | |
bool | isPreconditionerSet () const |
Return true if preconditioner has been setted. More... | |
void | showMe (std::ostream &output=std::cout) const |
Print informations about the solver. More... | |
Set Method | |
void | setCommunicator (const std::shared_ptr< Epetra_Comm > &comm) |
Method to set communicator for Displayer (for empty constructor) More... | |
void | setMatrix (matrix_type &matrix) |
Method to set matrix from MatrixEpetra. More... | |
void | setOperator (Epetra_Operator &oper) |
Method to set a general linear operator (of class derived from Epetra_Operator) defining the linear system. More... | |
void | setPreconditioner (prec_type &preconditioner) |
Method to set an Preconditioner preconditioner. More... | |
void | setPreconditioner (comp_prec_type &preconditioner) |
Method to set a general Epetra_Operator as preconditioner. More... | |
void | setDataFromGetPot (const GetPot &dataFile, const std::string §ion) |
Method to setup the solver using GetPot. More... | |
void | setParameters (bool cerrWarningIfUnused=false) |
Set the current parameters with the internal parameters list. More... | |
void | setTolerance (const Real tolerance) |
Set the tolerance of the solver. More... | |
void | setMaxNumIterations (const Int maxIter=-1) |
Set the tolerance and the maximum number of iterations. More... | |
void | setReusePreconditioner (const bool reusePreconditioner) |
Specify if the preconditioner should be reuse or not. More... | |
std::shared_ptr< Displayer > | displayer () |
Return the displayer. More... | |
Get Method | |
Int | numIterations () const |
Return the total number of iterations. More... | |
Int | maxNumIterations () const |
Return the maximum total number of iterations. More... | |
Real | trueResidual () |
Return the true residual. More... | |
prec_type & | preconditioner () |
Method to get a shared pointer to the preconditioner (of type derived from Preconditioner)*/. More... | |
void | aztecStatus (Real status[AZ_STATUS_SIZE]) |
Return the AztecStatus. More... | |
Teuchos::ParameterList & | getParametersList () |
Return a Teuchos parameters list. More... | |
AztecOO & | solver () |
Return a reference on the AztecOO solver. More... | |
SolverAztecOO - Class to wrap linear solver.
By default the solver is gmres and the preconditioner is ilu.
Definition at line 78 of file SolverAztecOO.hpp.
typedef Real value_type |
Definition at line 85 of file SolverAztecOO.hpp.
typedef SolverAztecOO solver_type |
Definition at line 87 of file SolverAztecOO.hpp.
typedef MatrixEpetra<Real> matrix_type |
Definition at line 89 of file SolverAztecOO.hpp.
typedef VectorEpetra vector_type |
Definition at line 90 of file SolverAztecOO.hpp.
typedef Preconditioner prec_raw_type |
Definition at line 92 of file SolverAztecOO.hpp.
typedef std::shared_ptr<prec_raw_type> prec_type |
Definition at line 93 of file SolverAztecOO.hpp.
typedef std::shared_ptr<Epetra_Operator> comp_prec_type |
Definition at line 94 of file SolverAztecOO.hpp.
typedef std::shared_ptr<matrix_type> matrix_ptrtype |
Definition at line 95 of file SolverAztecOO.hpp.
typedef std::shared_ptr<VectorEpetra> vector_ptrtype |
Definition at line 96 of file SolverAztecOO.hpp.
LIFEV_DEPRECATED | ( | SolverAztecOO() | ) |
Empty constructor.
LIFEV_DEPRECATED | ( | SolverAztecOO(const std::shared_ptr< Epetra_Comm > &comm) | ) |
Constructor.
comm | Communicator |
Int solve | ( | vector_type & | solution, |
const vector_type & | rhs | ||
) |
Solve the problem .
A has been entered via setMatrix
.
solution | Vector to store the solution rhs Right hand side of the problem |
Definition at line 86 of file SolverAztecOO.cpp.
Real computeResidual | ( | vector_type & | solution, |
vector_type & | rhs | ||
) |
Compute the residual.
solution | Solution of the system |
rhs | Right hand side of the problem |
Definition at line 137 of file SolverAztecOO.cpp.
std::string printStatus | ( | ) |
return the Aztec status
Definition at line 154 of file SolverAztecOO.cpp.
Int solveSystem | ( | const vector_type & | rhsFull, |
vector_type & | solution, | ||
matrix_ptrtype & | baseMatrixForPreconditioner | ||
) |
Solves the system and returns the number of iterations.
The Matrix has already been passed by the method setMatrix or setOperator
The preconditioner is build starting from the matrix baseMatrixForPreconditioner by the preconditioner object passed in by the method setPreconditioner
rhsFull | Right hand side |
solution | vector to store the solution |
baseMatrixForPreconditioner | Base matrix for the preconditioner construction |
Definition at line 192 of file SolverAztecOO.cpp.
Int solveSystem | ( | const vector_type & | rhsFull, |
vector_type & | solution, | ||
PrecPtrOperator | preconditionerPtr | ||
) |
Solves the system and returns the number of iterations.
The Matrix has already been passed by the method setMatrix or setOperator
rhsFull | Right hand side |
solution | Vector to store the solution |
preconditionerPtr | Pointer on a preconditioner to use (templated parameter, can derive from Preconditioner class or from Epetra_Operator) |
Definition at line 305 of file SolverAztecOO.hpp.
void setupPreconditioner | ( | const GetPot & | dataFile, |
const std::string & | section | ||
) |
Setup the preconditioner.
dataFile | GetPot object which contains the data about the preconditioner |
section | Section the GetPot structure where to find the informations about the preconditioner |
Definition at line 253 of file SolverAztecOO.cpp.
void buildPreconditioner | ( | matrix_ptrtype & | baseMatrixForPreconditioner | ) |
Builds the preconditioner starting from the matrix "baseMatrixForPreconditioner".
The preconditioner is build starting from the matrix baseMatrixForPreconditioner by the preconditioner object passed in by the method setPreconditioner
baseMatrixForPreconditioner | Base matrix for the preconditioner construction |
Definition at line 263 of file SolverAztecOO.cpp.
void resetPreconditioner | ( | ) |
Delete the stored preconditioner.
Definition at line 281 of file SolverAztecOO.cpp.
bool isPreconditionerSet | ( | ) | const |
Return true if preconditioner has been setted.
Definition at line 287 of file SolverAztecOO.cpp.
void showMe | ( | std::ostream & | output = std::cout | ) | const |
Print informations about the solver.
Definition at line 293 of file SolverAztecOO.cpp.
void setCommunicator | ( | const std::shared_ptr< Epetra_Comm > & | comm | ) |
Method to set communicator for Displayer (for empty constructor)
comm | Communicator for the displayer |
Definition at line 302 of file SolverAztecOO.cpp.
void setMatrix | ( | matrix_type & | matrix | ) |
Method to set matrix from MatrixEpetra.
matrix | Matrix of the system |
Definition at line 307 of file SolverAztecOO.cpp.
void setOperator | ( | Epetra_Operator & | oper | ) |
Method to set a general linear operator (of class derived from Epetra_Operator) defining the linear system.
oper | Operator for the system |
Definition at line 314 of file SolverAztecOO.cpp.
void setPreconditioner | ( | prec_type & | preconditioner | ) |
Method to set an Preconditioner preconditioner.
preconditioner | Preconditioner to be used to solve the system |
Definition at line 320 of file SolverAztecOO.cpp.
void setPreconditioner | ( | comp_prec_type & | preconditioner | ) |
Method to set a general Epetra_Operator as preconditioner.
preconditioner | Preconditioner to be set of type Epetra_Operator |
Definition at line 326 of file SolverAztecOO.cpp.
void setDataFromGetPot | ( | const GetPot & | dataFile, |
const std::string & | section | ||
) |
Method to setup the solver using GetPot.
dataFile | GetPot object which contains the data about the solver |
Definition at line 332 of file SolverAztecOO.cpp.
void setParameters | ( | bool | cerrWarningIfUnused = false | ) |
Set the current parameters with the internal parameters list.
Note: The parameter list is set using "setDataFromGetPot".
cerrWarningIfUnused | If true the solver return warning if some parameters are unused |
Definition at line 376 of file SolverAztecOO.cpp.
void setTolerance | ( | const Real | tolerance | ) |
Set the tolerance of the solver.
tolerance | Tolerance for the solver |
Definition at line 382 of file SolverAztecOO.cpp.
void setMaxNumIterations | ( | const Int | maxIter = -1 | ) |
Set the tolerance and the maximum number of iterations.
maxIter | Maximum number of iteration |
Definition at line 392 of file SolverAztecOO.cpp.
void setReusePreconditioner | ( | const bool | reusePreconditioner | ) |
Specify if the preconditioner should be reuse or not.
reusePreconditioner | If set to true, do not recompute the preconditioner |
Definition at line 402 of file SolverAztecOO.cpp.
std::shared_ptr< Displayer > displayer | ( | ) |
Return the displayer.
Definition at line 408 of file SolverAztecOO.cpp.
Int numIterations | ( | ) | const |
Return the total number of iterations.
Definition at line 417 of file SolverAztecOO.cpp.
Int maxNumIterations | ( | ) | const |
Return the maximum total number of iterations.
Definition at line 423 of file SolverAztecOO.cpp.
Real trueResidual | ( | ) |
Return the true residual.
Definition at line 430 of file SolverAztecOO.cpp.
SolverAztecOO::prec_type & preconditioner | ( | ) |
Method to get a shared pointer to the preconditioner (of type derived from Preconditioner)*/.
Definition at line 436 of file SolverAztecOO.cpp.
void aztecStatus | ( | Real | status[AZ_STATUS_SIZE] | ) |
Return the AztecStatus.
Definition at line 442 of file SolverAztecOO.cpp.
Teuchos::ParameterList & getParametersList | ( | ) |
Return a Teuchos parameters list.
Definition at line 448 of file SolverAztecOO.cpp.
AztecOO & solver | ( | ) |
Return a reference on the AztecOO solver.
Definition at line 454 of file SolverAztecOO.cpp.
|
private |
Definition at line 290 of file SolverAztecOO.hpp.
|
private |
Definition at line 291 of file SolverAztecOO.hpp.
|
private |
Definition at line 293 of file SolverAztecOO.hpp.
|
private |
Definition at line 295 of file SolverAztecOO.hpp.
|
private |
Definition at line 296 of file SolverAztecOO.hpp.
|
private |
Definition at line 298 of file SolverAztecOO.hpp.
|
private |
Definition at line 299 of file SolverAztecOO.hpp.
|
private |
Definition at line 300 of file SolverAztecOO.hpp.
|
private |
Definition at line 301 of file SolverAztecOO.hpp.