Add Python argument to Schedule constructor

This commit is contained in:
Joakim Hove
2020-03-25 20:21:28 +01:00
parent 54cd4f96f7
commit 30216212c4
7 changed files with 21 additions and 8 deletions

View File

@@ -331,6 +331,7 @@ int main(int argc, char** argv)
std::cout << "Reading deck file '" << deckFilename << "'\n";
std::cout.flush();
}
Opm::Python python;
std::shared_ptr<Opm::Deck> deck;
std::shared_ptr<Opm::EclipseState> eclipseState;
std::shared_ptr<Opm::Schedule> schedule;
@@ -376,9 +377,9 @@ int main(int argc, char** argv)
const auto& rst_filename = eclipseState->getIOConfig().getRestartFileName( init_config.getRestartRootName(), report_step, false );
Opm::EclIO::ERst rst_file(rst_filename);
const auto& rst_state = Opm::RestartIO::RstState::load(rst_file, report_step);
schedule.reset(new Opm::Schedule(*deck, *eclipseState, parseContext, errorGuard, &rst_state) );
schedule.reset(new Opm::Schedule(*deck, *eclipseState, parseContext, errorGuard, python, &rst_state) );
} else
schedule.reset(new Opm::Schedule(*deck, *eclipseState, parseContext, errorGuard));
schedule.reset(new Opm::Schedule(*deck, *eclipseState, parseContext, errorGuard, python));
setupMessageLimiter(schedule->getMessageLimits(), "STDOUT_LOGGER");
summaryConfig.reset( new Opm::SummaryConfig(*deck, *schedule, eclipseState->getTableManager(), parseContext, errorGuard));

View File

@@ -33,6 +33,7 @@
#include <opm/common/OpmLog/EclipsePRTLog.hpp>
#include <opm/common/OpmLog/LogUtil.hpp>
#include <opm/parser/eclipse/Python/Python.hpp>
#include <opm/parser/eclipse/Deck/Deck.hpp>
#include <opm/parser/eclipse/Parser/Parser.hpp>
#include <opm/parser/eclipse/EclipseState/EclipseState.hpp>
@@ -354,6 +355,7 @@ int mainFlow(int argc, char** argv)
std::cout << "Reading deck file '" << deckFilename << "'\n";
std::cout.flush();
}
Opm::Python python;
std::shared_ptr<Opm::Deck> deck;
std::shared_ptr<Opm::EclipseState> eclipseState;
std::shared_ptr<Opm::Schedule> schedule;
@@ -390,7 +392,7 @@ int mainFlow(int argc, char** argv)
#else
eclipseState.reset(new Opm::EclipseState(*deck));
#endif
schedule.reset(new Opm::Schedule(*deck, *eclipseState, parseContext, errorGuard));
schedule.reset(new Opm::Schedule(*deck, *eclipseState, parseContext, errorGuard, python));
setupMessageLimiter(schedule->getMessageLimits(), "STDOUT_LOGGER");
summaryConfig.reset( new Opm::SummaryConfig(*deck, *schedule, eclipseState->getTableManager(), parseContext, errorGuard));
}