GEOSX
Public Types | Protected Types | Protected Attributes | List of all members
geosx::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 geosx::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 geosx::KrylovSolver< VECTOR >
using Base = LinearOperator< VECTOR >
 Base type.
 
using Vector = typename Base::Vector
 Alias for template parameter.
 
- Public Types inherited from geosx::LinearOperator< VECTOR >
using Vector = VECTOR
 Alias for template parameter.
 

Public Member Functions

Constructor/Destructor Methods
 GMRESsolver (LinearOperator< Vector > const &matrix, LinearOperator< Vector > const &precond, real64 const tolerance, localIndex const maxIterations, integer const verbosity=0, localIndex const maxRestart=100)
 Solver object constructor. More...
 
virtual ~GMRESsolver () override
 Virtual destructor.
 
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 geosx::KrylovSolver< VECTOR >
 KrylovSolver (LinearOperator< Vector > const &matrix, LinearOperator< Vector > const &precond, real64 const tolerance, localIndex const maxIterations, integer const verbosity)
 Constructor. More...
 
virtual ~KrylovSolver () override=default
 Virtual destructor.
 
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
 Get the number of global rows. More...
 
virtual globalIndex numGlobalCols () const override final
 Get the number of global columns. More...
 
LinearSolverResult const & result () const
 Get result of a linear solve. More...
 
arrayView1d< real64 const > history () const
 Get convergence history of a linear solve. More...
 
integer getLogLevel () const
 Get log level. More...
 
- Public Member Functions inherited from geosx::LinearOperator< VECTOR >
 LinearOperator ()=default
 Constructor.
 
virtual ~LinearOperator ()=default
 Destructor.
 
virtual void apply (Vector const &src, Vector &dst) const =0
 Apply operator to a vector. More...
 
virtual void residual (Vector const &x, Vector const &b, Vector &r) const
 Compute residual r = Ax - b. More...
 

Protected Types

using VectorTemp = typename KrylovSolver< VECTOR >::VectorTemp
 Alias for vector type that can be used for temporaries.
 
- Protected Types inherited from geosx::KrylovSolver< VECTOR >
using VectorTemp = typename VectorStorageHelper< VECTOR >::type
 Alias for vector type that can be used for temporaries.
 

Protected Attributes

localIndex m_maxRestart
 Number of iterations needed to restart GMRES.
 
array1d< VectorTempm_kspace
 Storage for Krylov subspace vectors.
 
bool m_kspaceInitialized
 Flag indicating whether kspace vectors have been created.
 
- Protected Attributes inherited from geosx::KrylovSolver< VECTOR >
LinearOperator< Vector > const & m_operator
 reference to the operator to be solved
 
LinearOperator< Vector > const & m_precond
 reference to the preconditioning operator
 
real64 m_tolerance
 relative residual norm reduction tolerance
 
localIndex m_maxIterations
 maximum number of Krylov iterations
 
integer m_logLevel
 solver verbosity level
 
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 geosx::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...
 
- Protected Member Functions inherited from geosx::KrylovSolver< VECTOR >
void logProgress (localIndex const iter, real64 const rnorm) const
 Output iteration progress (called by implementations). More...
 
void logResult () const
 Output convergence result (called by implementations).
 
- Static Protected Member Functions inherited from geosx::KrylovSolver< VECTOR >
static VectorTemp createTempVector (Vector const &src)
 Helper function to create temporary vectors based on a source vector. More...
 

Detailed Description

template<typename VECTOR>
class geosx::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 37 of file GMRESsolver.hpp.

Constructor & Destructor Documentation

◆ GMRESsolver()

template<typename VECTOR >
geosx::GMRESsolver< VECTOR >::GMRESsolver ( LinearOperator< Vector > const &  matrix,
LinearOperator< Vector > const &  precond,
real64 const  tolerance,
localIndex const  maxIterations,
integer const  verbosity = 0,
localIndex const  maxRestart = 100 
)

Solver object constructor.

Parameters
[in]matrixreference to the system matrix
[in]precondreference to the preconditioning operator
[in]tolerancerelative residual norm reduction tolerance
[in]maxIterationsmaximum number of Krylov iterations
[in]verbositysolver verbosity level
[in]maxRestartnumber of iterations until restart

Member Function Documentation

◆ methodName()

template<typename VECTOR >
virtual string geosx::GMRESsolver< VECTOR >::methodName ( ) const
inlinefinaloverridevirtual

Get name of the Krylov subspace method.

Returns
the abbreviated name of the method

Implements geosx::KrylovSolver< VECTOR >.

Definition at line 87 of file GMRESsolver.hpp.

◆ solve()

template<typename VECTOR >
virtual void geosx::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).

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