diff --git a/opm/input/eclipse/Schedule/Schedule.hpp b/opm/input/eclipse/Schedule/Schedule.hpp index e10c358f2..3f8991791 100644 --- a/opm/input/eclipse/Schedule/Schedule.hpp +++ b/opm/input/eclipse/Schedule/Schedule.hpp @@ -280,6 +280,7 @@ namespace Opm const std::map< std::string, int >& rst_keywords( size_t timestep ) const; SimulatorUpdate applyAction(std::size_t reportStep, const Action::ActionX& action, const std::vector& matching_wells, const std::unordered_map& wellpi); + SimulatorUpdate runPyAction(std::size_t reportStep, const Action::PyAction& pyaction, EclipseState& ecl_state, SummaryState& summary_state); void applyWellProdIndexScaling(const std::string& well_name, const std::size_t reportStep, const double scalingFactor); diff --git a/src/opm/input/eclipse/Schedule/Schedule.cpp b/src/opm/input/eclipse/Schedule/Schedule.cpp index 45417eda3..09ee4eedd 100644 --- a/src/opm/input/eclipse/Schedule/Schedule.cpp +++ b/src/opm/input/eclipse/Schedule/Schedule.cpp @@ -1332,6 +1332,12 @@ File {} line {}.)", pattern, location.keyword, location.filename, location.linen + SimulatorUpdate Schedule::runPyAction(std::size_t reportStep, const Action::PyAction& pyaction, EclipseState& ecl_state, SummaryState& summary_state) { + SimulatorUpdate sim_update; + pyaction.run(ecl_state, *this, reportStep, summary_state); + return sim_update; + } + void Schedule::applyWellProdIndexScaling(const std::string& well_name, const std::size_t reportStep, const double newWellPI) { if (reportStep >= this->snapshots.size()) return;