diff --git a/opm/autodiff/NewtonSolver.hpp b/opm/autodiff/NewtonSolver.hpp index edc673f0f..3f638c077 100644 --- a/opm/autodiff/NewtonSolver.hpp +++ b/opm/autodiff/NewtonSolver.hpp @@ -85,12 +85,20 @@ namespace Opm { /// Number of linear solver iterations used in all calls to step(). unsigned int linearIterations() const; + /// Number of linear solver iterations used in the last call to step(). + unsigned int newtonIterationsLastStep() const; + + /// Number of linear solver iterations used in the last call to step(). + unsigned int linearIterationsLastStep() const; + private: // --------- Data members --------- SolverParameters param_; PhysicalModel& model_; unsigned int newtonIterations_; unsigned int linearIterations_; + unsigned int newtonIterationsLast_; + unsigned int linearIterationsLast_; // --------- Private methods --------- enum RelaxType relaxType() const { return param_.relax_type_; } diff --git a/opm/autodiff/NewtonSolver_impl.hpp b/opm/autodiff/NewtonSolver_impl.hpp index 62af1ea10..efc3e5197 100644 --- a/opm/autodiff/NewtonSolver_impl.hpp +++ b/opm/autodiff/NewtonSolver_impl.hpp @@ -121,6 +121,8 @@ namespace Opm linearIterations_ += linearIterations; newtonIterations_ += iteration; + linearIterationsLast_ = linearIterations; + newtonIterationsLast_ = iteration; // Do model-specific post-step actions. model_.afterStep(dt, reservoir_state, well_state);