#include <solverlinear.hpp>
This class provides a uniform interface for linear solvers. This base class is overloaded to provide linear solvers from different packages like FEEL, GMM or PETSC
Public Types | |
typedef boost::shared_ptr < Preconditioner< T > > | preconditioner_ptrtype |
typedef type_traits< T >::real_type | real_type |
typedef boost::shared_ptr < SolverLinear< T > > | self_ptrtype |
typedef SolverLinear< T > | self_type |
typedef T | value_type |
Public Member Functions | |
value_type | aTolerance () const |
void | attachPreconditioner (preconditioner_ptrtype preconditioner) |
virtual void | clear () |
value_type | dTolerance () const |
FieldSplitType | fieldSplitType () const |
virtual void | init ()=0 |
bool | initialized () const |
MatSolverPackageType | matSolverPackageType () const |
size_type | maxIterations () const |
virtual MatrixStructure | precMatrixStructure () const |
PreconditionerType | preconditionerType () const |
std::string const & | prefix () const |
value_type | rTolerance () const |
void | setFieldSplitType (const FieldSplitType fst) |
void | setMatSolverPackageType (const MatSolverPackageType mspackt) |
virtual void | setPrecMatrixStructure (MatrixStructure mstruct) |
void | setPreconditionerType (const PreconditionerType pct) |
void | setPrefix (std::string const &p) |
void | setShowKSPConvergedReason (bool b) |
void | setShowKSPMonitor (bool b) |
void | setSolverType (const SolverType st) |
void | setWorldComm (WorldComm const &worldComm) |
bool | showKSPConvergedReason () const |
bool | showKSPMonitor () const |
virtual boost::tuple< bool, unsigned int, real_type > | solve (MatrixSparse< T > const &mat, Vector< T > &x, Vector< T > const &b, const double tolerance, const unsigned int maxit, bool transpose)=0 |
virtual boost::tuple< bool, unsigned int, real_type > | solve (MatrixSparse< T > const &mat, MatrixSparse< T > const &prec, Vector< T > &x, Vector< T > const &b, const double tolerance, const unsigned int maxit, bool transpose)=0 |
SolverLinear (WorldComm const &worldComm=Environment::worldComm()) | |
SolverLinear (po::variables_map const &vm, WorldComm const &worldComm=Environment::worldComm()) | |
SolverType | solverType () const |
po::variables_map | vm () const |
WorldComm const & | worldComm () const |
virtual | ~SolverLinear () |
Protected Member Functions | |
void | setInitialized (bool init) |
Protected Attributes | |
double | M_atolerance |
absolute tolerance | |
double | M_dtolerance |
divergence tolerance | |
FieldSplitType | M_fieldSplit_type |
bool | M_is_initialized |
MatSolverPackageType | M_matSolverPackage_type |
size_type | M_maxit |
maximum number of iterations | |
MatrixStructure | M_prec_matrix_structure |
preconditioner_ptrtype | M_preconditioner |
PreconditionerType | M_preconditioner_type |
std::string | M_prefix |
double | M_rtolerance |
relative tolerance | |
bool | M_showKSPConvergedReason |
bool | M_showKSPMonitor |
SolverType | M_solver_type |
po::variables_map | M_vm |
|
inline |
Constructor. Initializes Solver data structures
|
inline |
Constructor. Initializes Solver data structures
|
inlinevirtual |
Destructor.
|
inline |
References Feel::SolverLinear< T >::M_atolerance.
|
inline |
Attaches a Preconditioner object to be used by the solver
References Feel::SolverLinear< T >::M_is_initialized, Feel::SolverLinear< T >::M_preconditioner, and Feel::SolverLinear< T >::M_preconditioner_type.
|
inlinevirtual |
Release all memory and clear data structures.
|
inline |
References Feel::SolverLinear< T >::M_dtolerance.
|
pure virtual |
Initialize data structures if not done so already.
|
inline |
References Feel::SolverLinear< T >::M_is_initialized.
|
inline |
Returns the type of preconditioner to use.
References Feel::SolverLinear< T >::M_matSolverPackage_type.
|
inline |
References Feel::SolverLinear< T >::M_maxit.
|
inlinevirtual |
|
inline |
Returns the type of preconditioner to use.
References Feel::SolverLinear< T >::M_preconditioner, and Feel::SolverLinear< T >::M_preconditioner_type.
|
inline |
|
inline |
References Feel::SolverLinear< T >::M_rtolerance.
|
inlineprotected |
set initialized only for subclasses
References Feel::SolverLinear< T >::init(), and Feel::SolverLinear< T >::M_is_initialized.
|
inline |
Sets the type of preconditioner to use.
References Feel::SolverLinear< T >::M_matSolverPackage_type.
|
inlinevirtual |
References Feel::SolverLinear< T >::M_preconditioner.
|
inline |
Sets the type of preconditioner to use.
References Feel::SolverLinear< T >::M_preconditioner, and Feel::SolverLinear< T >::M_preconditioner_type.
|
inline |
set the prefix of the solver (typically for command line options)
|
inline |
Sets the type of solver to use.
References Feel::SolverLinear< T >::M_solver_type.
|
inline |
show KSP converged reason
|
inline |
show KSP monitor
|
pure virtual |
This function calls the solver "M_solver_type" preconditioned with the "M_preconditioner_type" preconditioner. Note that this method will compute the preconditioner from the system matrix.
mat | System Matrix |
prec | Preconditioning Matrix |
x | Solution vector |
b | RHS vector |
tolerance | Stopping tolerance |
maxit | maximum Number of Iterations |
transpose | true to solve the transpose system, false otherwise |
|
pure virtual |
This function calls the solver "M_solver_type" preconditioned with the "M_preconditioner_type" preconditioner. Note that this method will compute the preconditioner from the system matrix.
mat | System Matrix |
prec | Preconditioning Matrix |
x | Solution vector |
b | RHS vector |
tolerance | Stopping tolerance |
maxit | maximum Number of Iterations |
transpose | true to solve the transpose system, false otherwise |
|
inline |
Returns the type of solver to use.
References Feel::SolverLinear< T >::M_solver_type.
|
inline |
return variables_map
|
protected |
Flag indicating if the data structures have been initialized.
|
protected |
Enum the software that is used to perform the factorization
|
protected |
Holds the Preconditioner object to be used for the linear solves.
|
protected |
Enum statitng with type of preconditioner to use.
|
protected |
Enum stating which type of iterative solver to use.