19 #ifndef GEOSX_LINEARALGEBRA_SOLVERS_CGSOLVER_HPP_ 20 #define GEOSX_LINEARALGEBRA_SOLVERS_CGSOLVER_HPP_ 22 #include "linearAlgebra/solvers/KrylovSolver.hpp" 36 template<
typename VECTOR >
virtual string methodName() const override final
Get name of the Krylov subspace method.
typename VectorStorageHelper< VECTOR >::type VectorTemp
Alias for vector type that can be used for temporaries.
virtual void solve(Vector const &b, Vector &x) const override final
Solve preconditioned system.
integer m_logLevel
solver verbosity level
LinearOperator< Vector > const & m_operator
reference to the operator to be solved
LinearOperator< Vector > const & m_precond
reference to the preconditioning operator
void logProgress(localIndex const iter, real64 const rnorm) const
Output iteration progress (called by implementations).
This class implements Conjugate Gradient method for monolithic and block linear operators.
static VectorTemp createTempVector(Vector const &src)
Helper function to create temporary vectors based on a source vector.
double real64
64-bit floating point type.
array1d< real64 > m_residualNorms
Absolute residual norms at each iteration (if available)
typename Base::Vector Vector
Alias for template parameter.
typename KrylovSolver< VECTOR >::VectorTemp VectorTemp
Alias for vector type that can be used for temporaries.
real64 m_tolerance
relative residual norm reduction tolerance
virtual ~CGsolver() override
Virtual destructor.
std::int32_t integer
Signed integer type.
localIndex m_maxIterations
maximum number of Krylov iterations
std::ptrdiff_t localIndex
Local index type (for indexing objects within an MPI partition).
void logResult() const
Output convergence result (called by implementations).
VECTOR Vector
Alias for template parameter.
LinearSolverResult m_result
results of a solve
Base class for Krylov solvers.
CGsolver(LinearOperator< Vector > const &A, LinearOperator< Vector > const &M, real64 const tolerance, localIndex const maxIterations, integer const verbosity=0)
Constructor.