From ac38491883d75dcd61529479f0747b49e83d9913 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C3=A5rd=20Skaflestad?= Date: Wed, 6 Jun 2012 16:35:36 +0200 Subject: [PATCH] Implement *Tolerance() methods from LinearSolverInterface See cset f08b1fb48d19 for additional details. --- opm/core/linalg/LinearSolverAGMG.cpp | 12 ++++++++++++ opm/core/linalg/LinearSolverAGMG.hpp | 8 ++++++++ 2 files changed, 20 insertions(+) diff --git a/opm/core/linalg/LinearSolverAGMG.cpp b/opm/core/linalg/LinearSolverAGMG.cpp index e028e2c5..ae76bd4e 100644 --- a/opm/core/linalg/LinearSolverAGMG.cpp +++ b/opm/core/linalg/LinearSolverAGMG.cpp @@ -121,4 +121,16 @@ namespace Opm rpt.converged = rpt.iterations <= max_it_; return rpt; } + + void + LinearSolverAGMG::setTolerance(const double tol) + { + rtol_ = tol; + } + + double + LinearSolverAGMG::getTolerance() const + { + return rtol_; + } } // namespace Opm diff --git a/opm/core/linalg/LinearSolverAGMG.hpp b/opm/core/linalg/LinearSolverAGMG.hpp index 6056dc90..813d57b8 100644 --- a/opm/core/linalg/LinearSolverAGMG.hpp +++ b/opm/core/linalg/LinearSolverAGMG.hpp @@ -82,6 +82,14 @@ namespace Opm const int* ia, const int* ja, const double* sa, const double* rhs, double* solution) const; + /// Set tolerance for the linear solver. + /// \param[in] tol tolerance value + virtual void setTolerance(const double tol); + + /// Get tolerance for the linear solver. + /// \return tolerance value + virtual double getTolerance() const; + private: int max_it_; double rtol_ ;