|
GEOS
|
Base class for Krylov solvers. More...
#include <KrylovSolver.hpp>

Public Types | |
| using | Base = LinearOperator< VECTOR > |
| Base type. | |
| using | Vector = typename Base::Vector |
| Alias for template parameter. | |
Public Types inherited from geos::LinearOperator< VECTOR > | |
| using | Vector = VECTOR |
| Alias for template parameter. | |
Public Member Functions | |
| KrylovSolver (LinearSolverParameters params, LinearOperator< Vector > const &matrix, LinearOperator< Vector > const &precond) | |
| Constructor. More... | |
| virtual void | solve (Vector const &b, Vector &x) const =0 |
| Solve preconditioned system. More... | |
| virtual void | apply (Vector const &src, Vector &dst) const override final |
| Apply operator to a vector. More... | |
| virtual globalIndex | numGlobalRows () const override final |
| virtual globalIndex | numGlobalCols () const override final |
| virtual localIndex | numLocalRows () const override final |
| virtual localIndex | numLocalCols () const override final |
| virtual MPI_Comm | comm () const override final |
| Get the MPI communicator the matrix was created with. More... | |
| LinearSolverParameters const & | parameters () const |
| LinearSolverResult const & | result () const |
| arrayView1d< real64 const > | history () const |
| Get convergence history of a linear solve. More... | |
| virtual string | methodName () const =0 |
| Get name of the Krylov subspace method. More... | |
Public Member Functions inherited from geos::LinearOperator< VECTOR > | |
| LinearOperator ()=default | |
| Constructor. | |
| virtual | ~LinearOperator ()=default |
| Destructor. | |
| virtual void | residual (Vector const &x, Vector const &b, Vector &r) const |
Compute residual r = b - this(x). More... | |
| virtual globalIndex | numGlobalNonzeros () const |
| virtual localIndex | numLocalNonzeros () const |
Static Public Member Functions | |
| static std::unique_ptr< KrylovSolver< VECTOR > > | create (LinearSolverParameters const ¶meters, LinearOperator< VECTOR > const &matrix, LinearOperator< VECTOR > const &precond) |
| Factory method for instantiating Krylov solver objects. More... | |
Protected Types | |
| using | VectorTemp = typename VectorStorageHelper< VECTOR >::type |
| Alias for vector type that can be used for temporaries. | |
Protected Member Functions | |
| void | logProgress () const |
| Output iteration progress (called by implementations). More... | |
| void | logResult () const |
| Output convergence result (called by implementations). | |
Static Protected Member Functions | |
| static VectorTemp | createTempVector (Vector const &src) |
| Helper function to create temporary vectors based on a source vector. More... | |
Protected Attributes | |
| LinearSolverParameters | m_params |
| parameters of the solver | |
| LinearOperator< Vector > const & | m_operator |
| reference to the operator to be solved | |
| LinearOperator< Vector > const & | m_precond |
| reference to the preconditioning operator | |
| LinearSolverResult | m_result |
| results of a solve | |
| array1d< real64 > | m_residualNorms |
| Absolute residual norms at each iteration (if available) | |
Base class for Krylov solvers.
| VECTOR | type of vector handled by this solver |
Definition at line 37 of file KrylovSolver.hpp.
| geos::KrylovSolver< VECTOR >::KrylovSolver | ( | LinearSolverParameters | params, |
| LinearOperator< Vector > const & | matrix, | ||
| LinearOperator< Vector > const & | precond | ||
| ) |
Constructor.
| [in] | params | parameters solver parameters |
| [in] | matrix | reference to the system matrix |
| [in] | precond | reference to the preconditioning operator |
|
inlinefinaloverridevirtual |
Apply operator to a vector.
| src | Input vector (src). |
| dst | Output vector (dst). |
Implements geos::LinearOperator< VECTOR >.
Definition at line 81 of file KrylovSolver.hpp.
|
inlinefinaloverridevirtual |
Get the MPI communicator the matrix was created with.
create...()Implements geos::LinearOperator< VECTOR >.
Definition at line 106 of file KrylovSolver.hpp.
|
static |
Factory method for instantiating Krylov solver objects.
| parameters | solver parameters |
| matrix | linear operator to solve (can be a matrix or a matrix-free operator) |
| precond | preconditioning operator (must be set up by the user prior to calling solve()/apply()) |
|
inlinestaticprotected |
Helper function to create temporary vectors based on a source vector.
| src | the source vector, whose size and parallel distribution will be used |
The main purpose is to deal with BlockVector/View/Wrapper hierarchy.
Definition at line 189 of file KrylovSolver.hpp.
|
inline |
Get convergence history of a linear solve.
Definition at line 131 of file KrylovSolver.hpp.
|
protected |
Output iteration progress (called by implementations).
|
pure virtual |
Get name of the Krylov subspace method.
Implemented in geos::RichardsonSolver< VECTOR >, geos::GmresSolver< VECTOR >, geos::CgSolver< VECTOR >, and geos::BicgstabSolver< VECTOR >.
|
inlinefinaloverridevirtual |
Implements geos::LinearOperator< VECTOR >.
Definition at line 91 of file KrylovSolver.hpp.
|
inlinefinaloverridevirtual |
Implements geos::LinearOperator< VECTOR >.
Definition at line 86 of file KrylovSolver.hpp.
|
inlinefinaloverridevirtual |
Implements geos::LinearOperator< VECTOR >.
Definition at line 101 of file KrylovSolver.hpp.
|
inlinefinaloverridevirtual |
Implements geos::LinearOperator< VECTOR >.
Definition at line 96 of file KrylovSolver.hpp.
|
inline |
Definition at line 114 of file KrylovSolver.hpp.
|
inline |
Definition at line 122 of file KrylovSolver.hpp.
|
pure virtual |
Solve preconditioned system.
| [in] | b | system right hand side. |
| [in,out] | x | system solution (input = initial guess, output = solution). |
Implemented in geos::RichardsonSolver< VECTOR >, geos::GmresSolver< VECTOR >, geos::CgSolver< VECTOR >, and geos::BicgstabSolver< VECTOR >.