From fab64f5afbacc0cb8e23a25e4ae9c018bd5d9b29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Atgeirr=20Fl=C3=B8=20Rasmussen?= Date: Tue, 1 Dec 2015 14:16:11 +0100 Subject: [PATCH] Add non-const overload of model(). --- opm/autodiff/NonlinearSolver.hpp | 3 +++ opm/autodiff/NonlinearSolver_impl.hpp | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/opm/autodiff/NonlinearSolver.hpp b/opm/autodiff/NonlinearSolver.hpp index f6632a448..641cb2fd0 100644 --- a/opm/autodiff/NonlinearSolver.hpp +++ b/opm/autodiff/NonlinearSolver.hpp @@ -100,6 +100,9 @@ namespace Opm { /// Reference to physical model. const PhysicalModel& model() const; + /// Mutable reference to physical model. + PhysicalModel& model(); + /// Detect oscillation or stagnation in a given residual history. void detectOscillations(const std::vector>& residual_history, const int it, bool& oscillate, bool& stagnate) const; diff --git a/opm/autodiff/NonlinearSolver_impl.hpp b/opm/autodiff/NonlinearSolver_impl.hpp index bffc0b6ce..d35d1fa8f 100644 --- a/opm/autodiff/NonlinearSolver_impl.hpp +++ b/opm/autodiff/NonlinearSolver_impl.hpp @@ -60,6 +60,12 @@ namespace Opm return *model_; } + template + PhysicalModel& NonlinearSolver::model() + { + return *model_; + } + template unsigned int NonlinearSolver::nonlinearIterationsLastStep() const {