diff --git a/opm/simulators/timestepping/SimulatorTimer.cpp b/opm/simulators/timestepping/SimulatorTimer.cpp index 273fd0805..9ce0d1c51 100644 --- a/opm/simulators/timestepping/SimulatorTimer.cpp +++ b/opm/simulators/timestepping/SimulatorTimer.cpp @@ -115,15 +115,6 @@ namespace Opm } - boost::posix_time::ptime SimulatorTimer::currentDateTime() const - { - // Boost uses only 32 bit long for seconds, but 64 bit for milliseconds. - // As a workaround for very large times we just use milliseconds. - // The cast is necessary because boost::posix_time::milliseconds requires - // an integer argument. - return startDateTime() + boost::posix_time::milliseconds(static_cast(simulationTimeElapsed() / Opm::prefix::milli)); - } - /// Total time. double SimulatorTimer::totalTime() const { diff --git a/opm/simulators/timestepping/SimulatorTimer.hpp b/opm/simulators/timestepping/SimulatorTimer.hpp index 8f5b1cc72..7d8efab17 100644 --- a/opm/simulators/timestepping/SimulatorTimer.hpp +++ b/opm/simulators/timestepping/SimulatorTimer.hpp @@ -90,9 +90,6 @@ namespace Opm /// Return start date of simulation boost::posix_time::ptime startDateTime() const override; - /// Return current date. - boost::posix_time::ptime currentDateTime() const override; - /// Set total time. /// This is primarily intended for multi-epoch schedules, /// where a timer for a given epoch does not have diff --git a/opm/simulators/timestepping/SimulatorTimerInterface.cpp b/opm/simulators/timestepping/SimulatorTimerInterface.cpp index ab61a0204..8b93dfbff 100644 --- a/opm/simulators/timestepping/SimulatorTimerInterface.cpp +++ b/opm/simulators/timestepping/SimulatorTimerInterface.cpp @@ -19,7 +19,7 @@ #include #include - +#include #include namespace Opm @@ -27,8 +27,11 @@ namespace Opm boost::posix_time::ptime SimulatorTimerInterface::currentDateTime() const { - return startDateTime() + boost::posix_time::seconds( (int) simulationTimeElapsed()); - //boost::posix_time::ptime(startDate()) + boost::posix_time::seconds( (int) simulationTimeElapsed()); + // Boost uses only 32 bit long for seconds, but 64 bit for milliseconds. + // As a workaround for very large times we just use milliseconds. + // The cast is necessary because boost::posix_time::milliseconds requires + // an integer argument. + return startDateTime() + boost::posix_time::milliseconds(static_cast(simulationTimeElapsed() / Opm::prefix::milli)); } time_t SimulatorTimerInterface::currentPosixTime() const