SimulatorTimer: make it possible to base it on opm-parser's TimeMap

Since SimulatorTimer is a fairly shallow shim if using the TimeMap, it
can also be removed relatively easily. Having said this, that would
trigger _many_ changes in _a lot_ of places and I'm not motivated at
all to fight that battle as long as the old parser needs to be
supported. I thus decided that the best way is to add a "wrapper mode"
to SimulationTimer...
This commit is contained in:
Andreas Lauser
2014-02-20 17:59:41 +01:00
parent f30ab55974
commit 85a0032247
2 changed files with 55 additions and 11 deletions

View File

@@ -20,6 +20,8 @@
#ifndef OPM_SIMULATORTIMER_HEADER_INCLUDED
#define OPM_SIMULATORTIMER_HEADER_INCLUDED
#include <opm/parser/eclipse/EclipseState/Schedule/TimeMap.hpp>
#include <iosfwd>
#include <vector>
#include <boost/date_time/gregorian/gregorian.hpp>
@@ -47,6 +49,10 @@ namespace Opm
/// Note that DATES are folded into TSTEP by the parser.
void init(const EclipseGridParser& deck);
/// Use the SimulatorTimer as a shim around opm-parser's Opm::TimeMap
void init(TimeMapConstPtr timeMap,
int timeStepIdx = 0);
/// Total number of steps.
int numSteps() const;
@@ -99,6 +105,7 @@ namespace Opm
bool done() const;
private:
Opm::TimeMapConstPtr timeMap_;
std::vector<double> timesteps_;
int current_step_;
double current_time_;