From 02a3ba39b59dd0aeec7204f5f75d276e67490ce5 Mon Sep 17 00:00:00 2001 From: Kai Bao Date: Mon, 4 Jul 2016 11:12:53 +0200 Subject: [PATCH] adding a initialStep() function to SimulatorTimer to indicate if the current step is the inital step. --- opm/simulators/timestepping/SimulatorTimer.cpp | 6 ++++++ opm/simulators/timestepping/SimulatorTimer.hpp | 3 +++ 2 files changed, 9 insertions(+) diff --git a/opm/simulators/timestepping/SimulatorTimer.cpp b/opm/simulators/timestepping/SimulatorTimer.cpp index 66e8e2ffe..df3140428 100644 --- a/opm/simulators/timestepping/SimulatorTimer.cpp +++ b/opm/simulators/timestepping/SimulatorTimer.cpp @@ -63,6 +63,12 @@ namespace Opm start_date_ = start_time.date(); } + /// Whether the current step is the first step. + bool SimulatorTimer::initialStep() const + { + return (current_step_ == 0); + } + /// Total number of steps. int SimulatorTimer::numSteps() const { diff --git a/opm/simulators/timestepping/SimulatorTimer.hpp b/opm/simulators/timestepping/SimulatorTimer.hpp index 4db760930..52494a391 100644 --- a/opm/simulators/timestepping/SimulatorTimer.hpp +++ b/opm/simulators/timestepping/SimulatorTimer.hpp @@ -49,6 +49,9 @@ namespace Opm /// Use the SimulatorTimer as a shim around opm-parser's Opm::TimeMap void init(TimeMapConstPtr timeMap, size_t report_step = 0); + /// Whether the current step is the first step. + bool initialStep() const; + /// Total number of steps. int numSteps() const;