AdaptiveSimulatorTimer: void boost includes in header

This commit is contained in:
Arne Morten Kvarving 2021-06-08 15:35:37 +02:00
parent fcb5d3dd82
commit 30d4cbc2f2
2 changed files with 6 additions and 3 deletions

View File

@ -27,13 +27,15 @@
#include <opm/parser/eclipse/Units/Units.hpp> #include <opm/parser/eclipse/Units/Units.hpp>
#include <opm/simulators/timestepping/AdaptiveSimulatorTimer.hpp> #include <opm/simulators/timestepping/AdaptiveSimulatorTimer.hpp>
#include <boost/date_time/posix_time/posix_time.hpp>
namespace Opm namespace Opm
{ {
AdaptiveSimulatorTimer:: AdaptiveSimulatorTimer::
AdaptiveSimulatorTimer( const SimulatorTimerInterface& timer, AdaptiveSimulatorTimer( const SimulatorTimerInterface& timer,
const double lastStepTaken, const double lastStepTaken,
const double maxTimeStep ) const double maxTimeStep )
: start_date_time_( timer.startDateTime() ) : start_date_time_( std::make_shared<boost::posix_time::ptime>(timer.startDateTime()) )
, start_time_( timer.simulationTimeElapsed() ) , start_time_( timer.simulationTimeElapsed() )
, total_time_( start_time_ + timer.currentStepLength() ) , total_time_( start_time_ + timer.currentStepLength() )
, report_step_( timer.reportStepNum() ) , report_step_( timer.reportStepNum() )
@ -160,7 +162,7 @@ AdaptiveSimulatorTimer& AdaptiveSimulatorTimer::operator++ ()
boost::posix_time::ptime AdaptiveSimulatorTimer::startDateTime() const boost::posix_time::ptime AdaptiveSimulatorTimer::startDateTime() const
{ {
return start_date_time_; return *start_date_time_;
} }
/// return copy of object /// return copy of object

View File

@ -24,6 +24,7 @@
#include <vector> #include <vector>
#include <algorithm> #include <algorithm>
#include <memory>
#include <numeric> #include <numeric>
#include <opm/simulators/timestepping/SimulatorTimerInterface.hpp> #include <opm/simulators/timestepping/SimulatorTimerInterface.hpp>
@ -106,7 +107,7 @@ namespace Opm
virtual std::unique_ptr< SimulatorTimerInterface > clone() const; virtual std::unique_ptr< SimulatorTimerInterface > clone() const;
protected: protected:
const boost::posix_time::ptime start_date_time_; std::shared_ptr<boost::posix_time::ptime> start_date_time_;
const double start_time_; const double start_time_;
const double total_time_; const double total_time_;
const int report_step_; const int report_step_;