GEOS
Public Types | Protected Types | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
geos::GmresSolver< VECTOR > Class Template Reference

This class implements Generalized Minimized RESidual method (right-preconditioned) for monolithic and block linear operators. More...

#include <GmresSolver.hpp>

Inheritance diagram for geos::GmresSolver< VECTOR >:
Inheritance graph
[legend]

Public Types

using Base = KrylovSolver< VECTOR >
 Alias for the base type.
 
using Vector = typename Base::Vector
 Alias for the vector type.
 
- Public Types inherited from geos::KrylovSolver< VECTOR >
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

Constructor/Destructor Methods
 GmresSolver (LinearSolverParameters params, LinearOperator< Vector > const &matrix, LinearOperator< Vector > const &precond)
 Solver object constructor. More...
 
KrylovSolver interface
virtual void solve (Vector const &b, Vector &x) const override final
 Solve preconditioned system. More...
 
virtual string methodName () const override final
 Get name of the Krylov subspace method. More...
 
- Public Member Functions inherited from geos::KrylovSolver< VECTOR >
 KrylovSolver (LinearSolverParameters params, LinearOperator< Vector > const &matrix, LinearOperator< Vector > const &precond)
 Constructor. More...
 
virtual ~KrylovSolver () override=default
 Virtual destructor.
 
virtual void apply (Vector const &src, Vector &dst) const override final
 Apply operator to a vector. More...
 
virtual globalIndex numGlobalRows () const override final
 Get the number of global rows. More...
 
virtual globalIndex numGlobalCols () const override final
 Get the number of global columns. More...
 
virtual localIndex numLocalRows () const override final
 Get the number of local rows. More...
 
virtual localIndex numLocalCols () const override final
 Get the number of local columns. More...
 
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...
 
- 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...
 

Protected Types

using VectorTemp = typename KrylovSolver< VECTOR >::VectorTemp
 Alias for vector type that can be used for temporaries.
 
- Protected Types inherited from geos::KrylovSolver< VECTOR >
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).
 
- Protected Member Functions inherited from geos::KrylovSolver< VECTOR >
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...
 
- Static Protected Member Functions inherited from geos::KrylovSolver< VECTOR >
static VectorTemp createTempVector (Vector const &src)
 Helper function to create temporary vectors based on a source vector. More...
 

Protected Attributes

array1d< VectorTempm_kspace
 Storage for Krylov subspace vectors.
 
bool m_kspaceInitialized
 Flag indicating whether kspace vectors have been created.
 
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
 
array1d< real64m_residualNorms
 Absolute residual norms at each iteration (if available)
 
LinearSolverResult m_result
 results of a solve
 
- Protected Attributes inherited from geos::KrylovSolver< VECTOR >
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< real64m_residualNorms
 Absolute residual norms at each iteration (if available)
 

Additional Inherited Members

- Static Public Member Functions inherited from geos::KrylovSolver< VECTOR >
static std::unique_ptr< KrylovSolver< VECTOR > > create (LinearSolverParameters const &parameters, LinearOperator< VECTOR > const &matrix, LinearOperator< VECTOR > const &precond)
 Factory method for instantiating Krylov solver objects. More...
 

Detailed Description

template<typename VECTOR>
class geos::GmresSolver< VECTOR >

This class implements Generalized Minimized RESidual method (right-preconditioned) for monolithic and block linear operators.

Template Parameters
VECTORtype of vectors this solver operates on.
Note
The notation is consistent with "Iterative Methods for Linear and Non-Linear Equations" from C.T. Kelley (1995) and "Iterative Methods for Sparse Linear Systems" from Y. Saad (2003).

Definition at line 38 of file GmresSolver.hpp.

Constructor & Destructor Documentation

◆ GmresSolver()

template<typename VECTOR >
geos::GmresSolver< VECTOR >::GmresSolver ( LinearSolverParameters  params,
LinearOperator< Vector > const &  matrix,
LinearOperator< Vector > const &  precond 
)

Solver object constructor.

Parameters
[in]paramsparameters for the solver
[in]matrixreference to the system matrix
[in]precondreference to the preconditioning operator

Member Function Documentation

◆ createTempVector()

template<typename VECTOR >
static VectorTemp geos::KrylovSolver< VECTOR >::createTempVector
inlinestaticprotected

Helper function to create temporary vectors based on a source vector.

Parameters
srcthe source vector, whose size and parallel distribution will be used
Returns
the new vector

The main purpose is to deal with BlockVector/View/Wrapper hierarchy.

Definition at line 191 of file KrylovSolver.hpp.

◆ logProgress()

template<typename VECTOR >
void geos::KrylovSolver< VECTOR >::logProgress
protected

Output iteration progress (called by implementations).

Note
must be called after pushing the most recent residual into m_residualNorms

◆ methodName()

template<typename VECTOR >
virtual string geos::GmresSolver< VECTOR >::methodName ( ) const
inlinefinaloverridevirtual

Get name of the Krylov subspace method.

Returns
the abbreviated name of the method

Implements geos::KrylovSolver< VECTOR >.

Definition at line 77 of file GmresSolver.hpp.

◆ solve()

template<typename VECTOR >
virtual void geos::GmresSolver< VECTOR >::solve ( Vector const &  b,
Vector x 
) const
finaloverridevirtual

Solve preconditioned system.

Parameters
[in]bsystem right hand side.
[in,out]xsystem solution (input = initial guess, output = solution).

Implements geos::KrylovSolver< VECTOR >.


The documentation for this class was generated from the following file: