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/simulators/timestepping/AdaptiveSimulatorTimer.hpp>
#include <boost/date_time/posix_time/posix_time.hpp>
namespace Opm
{
AdaptiveSimulatorTimer::
AdaptiveSimulatorTimer( const SimulatorTimerInterface& timer,
const double lastStepTaken,
const double maxTimeStep )
: start_date_time_( timer.startDateTime() )
: start_date_time_( std::make_shared<boost::posix_time::ptime>(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

View File

@ -24,6 +24,7 @@
#include <vector>
#include <algorithm>
#include <memory>
#include <numeric>
#include <opm/simulators/timestepping/SimulatorTimerInterface.hpp>
@ -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<boost::posix_time::ptime> start_date_time_;
const double start_time_;
const double total_time_;
const int report_step_;