mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
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:
@@ -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_;
|
||||
|
||||
Reference in New Issue
Block a user