diff --git a/opm/simulators/timestepping/AdaptiveSimulatorTimer.cpp b/opm/simulators/timestepping/AdaptiveSimulatorTimer.cpp index 8e0b30d1a..13e06ea5c 100644 --- a/opm/simulators/timestepping/AdaptiveSimulatorTimer.cpp +++ b/opm/simulators/timestepping/AdaptiveSimulatorTimer.cpp @@ -27,13 +27,15 @@ #include #include +#include + namespace Opm { AdaptiveSimulatorTimer:: AdaptiveSimulatorTimer( const SimulatorTimerInterface& timer, const double lastStepTaken, const double maxTimeStep ) - : start_date_time_( timer.startDateTime() ) + : start_date_time_( std::make_shared(timer.startDateTime()) ) , start_time_( timer.simulationTimeElapsed() ) , total_time_( start_time_ + timer.currentStepLength() ) , report_step_( timer.reportStepNum() ) @@ -160,7 +162,7 @@ AdaptiveSimulatorTimer& AdaptiveSimulatorTimer::operator++ () boost::posix_time::ptime AdaptiveSimulatorTimer::startDateTime() const { - return start_date_time_; + return *start_date_time_; } /// return copy of object diff --git a/opm/simulators/timestepping/AdaptiveSimulatorTimer.hpp b/opm/simulators/timestepping/AdaptiveSimulatorTimer.hpp index a813d6739..ff7394fba 100644 --- a/opm/simulators/timestepping/AdaptiveSimulatorTimer.hpp +++ b/opm/simulators/timestepping/AdaptiveSimulatorTimer.hpp @@ -24,6 +24,7 @@ #include #include +#include #include #include @@ -106,7 +107,7 @@ namespace Opm virtual std::unique_ptr< SimulatorTimerInterface > clone() const; protected: - const boost::posix_time::ptime start_date_time_; + std::shared_ptr start_date_time_; const double start_time_; const double total_time_; const int report_step_;