Use Schedule constructor.

This commit is contained in:
Joakim Hove
2017-10-29 21:06:19 +01:00
committed by Joakim Hove (IT SI SIB)
parent 63f4b6d734
commit 566f4fbb02
55 changed files with 267 additions and 106 deletions

View File

@@ -88,6 +88,7 @@ try
// If we have a "deck_filename", grid and props will be read from that.
bool use_deck = param.has("deck_filename");
std::shared_ptr< EclipseState > eclipseState;
std::shared_ptr< Schedule > schedule;
std::unique_ptr<GridManager> grid;
std::unique_ptr<BlackoilPropertiesInterface> props;
std::unique_ptr<RockCompressibility> rock_comp;
@@ -104,6 +105,12 @@ try
std::string deck_filename = param.get<std::string>("deck_filename");
auto deck = parser.parseFile(deck_filename , parseContext);
eclipseState.reset(new EclipseState(deck, parseContext));
schedule.reset( new Schedule(deck,
eclipseState->getInputGrid(),
eclipseState->get3DProperties(),
eclipseState->runspec().phases(),
parseContext));
// Grid init
grid.reset(new GridManager(eclipseState->getInputGrid()));
@@ -234,7 +241,7 @@ try
int step = 0;
SimulatorTimer simtimer;
// Use timer for last epoch to obtain total time.
const auto& timeMap = eclipseState->getSchedule().getTimeMap();
const auto& timeMap = schedule->getTimeMap();
simtimer.init(timeMap);
const double total_time = simtimer.totalTime();
for (size_t reportStepIdx = 0; reportStepIdx < timeMap.numTimesteps(); ++reportStepIdx) {
@@ -247,7 +254,7 @@ try
<< simtimer.numSteps() - step << ")\n\n" << std::flush;
// Create new wells, well_state
WellsManager wells(*eclipseState , reportStepIdx , *grid->c_grid());
WellsManager wells(*eclipseState , *schedule, reportStepIdx , *grid->c_grid());
// @@@ HACK: we should really make a new well state and
// properly transfer old well state to it every report step,
// since number of wells may change etc.