mirror of
https://github.com/OPM/opm-simulators.git
synced 2026-09-05 04:40:19 -05:00
Implements the Python step() method.
A resubmission of commit 8e4f748 in PR #2403 and PR #2444 and continues
the work in #2690 implementing Python bindings to the flow simulator.
The Python step() method advances the simulator one report step. Before
calling step() for the first time, step_init() must have been called.
This commit is contained in:
@@ -28,6 +28,14 @@ int BlackOilSimulator::run()
|
||||
return mainObject.runDynamic();
|
||||
}
|
||||
|
||||
int BlackOilSimulator::step()
|
||||
{
|
||||
if (!hasRunInit_) {
|
||||
throw std::logic_error("step() called before step_init()");
|
||||
}
|
||||
return mainEbos_->executeStep();
|
||||
}
|
||||
|
||||
int BlackOilSimulator::step_init()
|
||||
{
|
||||
|
||||
@@ -56,5 +64,6 @@ PYBIND11_MODULE(simulators, m)
|
||||
py::class_<Opm::Pybind::BlackOilSimulator>(m, "BlackOilSimulator")
|
||||
.def(py::init< const std::string& >())
|
||||
.def("run", &Opm::Pybind::BlackOilSimulator::run)
|
||||
.def("step", &Opm::Pybind::BlackOilSimulator::step)
|
||||
.def("step_init", &Opm::Pybind::BlackOilSimulator::step_init);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user