20 #ifndef GEOS_LINEARALGEBRA_SOLVERS_CGSOLVER_HPP_
21 #define GEOS_LINEARALGEBRA_SOLVERS_CGSOLVER_HPP_
23 #include "linearAlgebra/solvers/KrylovSolver.hpp"
37 template<
typename VECTOR >
This class implements Conjugate Gradient method for monolithic and block linear operators.
virtual string methodName() const override final
Get name of the Krylov subspace method.
virtual void solve(Vector const &b, Vector &x) const override final
Solve preconditioned system.
typename KrylovSolver< VECTOR >::VectorTemp VectorTemp
Alias for vector type that can be used for temporaries.
CgSolver(LinearSolverParameters params, LinearOperator< Vector > const &A, LinearOperator< Vector > const &M)
Constructor.
Base class for Krylov solvers.
LinearSolverResult m_result
results of a solve
LinearOperator< Vector > const & m_operator
reference to the operator to be solved
static VectorTemp createTempVector(Vector const &src)
Helper function to create temporary vectors based on a source vector.
void logResult() const
Output convergence result (called by implementations).
typename Base::Vector Vector
Alias for template parameter.
typename VectorStorageHelper< VECTOR >::type VectorTemp
Alias for vector type that can be used for temporaries.
LinearOperator< Vector > const & m_precond
reference to the preconditioning operator
void logProgress() const
Output iteration progress (called by implementations).
array1d< real64 > m_residualNorms
Absolute residual norms at each iteration (if available)
LinearSolverParameters m_params
parameters of the solver
VECTOR Vector
Alias for template parameter.
Set of parameters for a linear solver or preconditioner.