SimulatorTimer: include boost header instead of forwarding

drop the pointer usage which was used to enable forwarding
This commit is contained in:
Arne Morten Kvarving 2023-02-13 17:59:35 +01:00
parent c6632d5b83
commit 4786deeffc
2 changed files with 9 additions and 8 deletions

View File

@ -34,7 +34,7 @@ namespace Opm
SimulatorTimer::SimulatorTimer()
: current_step_(0),
current_time_(0.0),
start_date_(std::make_shared<boost::gregorian::date>(2012,1,1)) // A really arbitrary default starting value?!
start_date_(2012,1,1) // A really arbitrary default starting value?!
{
}
@ -61,7 +61,7 @@ namespace Opm
}
setCurrentStepNum(report_step);
*start_date_ = boost::posix_time::from_time_t(schedule.getStartTime()).date();
start_date_ = boost::posix_time::from_time_t(schedule.getStartTime()).date();
}
/// Whether the current step is the first step.
@ -111,7 +111,7 @@ namespace Opm
boost::posix_time::ptime SimulatorTimer::startDateTime() const
{
return boost::posix_time::ptime(*start_date_);
return boost::posix_time::ptime(start_date_);
}

View File

@ -23,10 +23,11 @@
#include <opm/input/eclipse/Schedule/Schedule.hpp>
#include <opm/simulators/timestepping/SimulatorTimerInterface.hpp>
#include <iosfwd>
#include <vector>
#include <boost/date_time/gregorian/gregorian_types.hpp>
namespace boost { namespace gregorian { class date; } }
#include <iosfwd>
#include <memory>
#include <vector>
namespace Opm
{
@ -114,14 +115,14 @@ namespace Opm
bool lastStepFailed() const override { return false; }
/// return copy of object
std::unique_ptr< SimulatorTimerInterface > clone() const override;
std::unique_ptr<SimulatorTimerInterface> clone() const override;
private:
std::vector<double> timesteps_;
int current_step_;
double current_time_;
double total_time_;
std::shared_ptr<boost::gregorian::date> start_date_;
boost::gregorian::date start_date_;
};