19 #ifndef OPM_PY_BASE_SIMULATOR_HEADER_INCLUDED 20 #define OPM_PY_BASE_SIMULATOR_HEADER_INCLUDED 25 #include <opm/simulators/flow/FlowMain.hpp> 26 #include <opm/simulators/flow/python/PyMain.hpp> 27 #include <opm/simulators/flow/python/PyFluidState.hpp> 28 #include <opm/simulators/flow/python/PyMaterialState.hpp> 29 #include <opm/simulators/flow/python/Pybind11Exporter.hpp> 31 #include <opm/input/eclipse/EclipseState/EclipseState.hpp> 32 #include <opm/input/eclipse/EclipseState/SummaryConfig/SummaryConfig.hpp> 33 #include <opm/input/eclipse/Schedule/Schedule.hpp> 34 #include <opm/input/eclipse/Deck/Deck.hpp> 43 template<
class TypeTag>
51 const std::vector<std::string>& args);
54 std::shared_ptr<EclipseState> state,
55 std::shared_ptr<Schedule> schedule,
56 std::shared_ptr<SummaryConfig> summary_config,
57 const std::vector<std::string>& args);
59 void advance(
int report_step);
61 bool checkSimulationFinished();
66 getFluidStateVariable(
const std::string& name)
const;
68 py::array_t<double> getCellVolumes();
72 py::array_t<double> getPorosity();
74 py::array_t<double> getPrimaryVariable(
const std::string& variable)
const;
75 py::array_t<int> getPrimaryVarMeaning(
const std::string& variable)
const;
77 std::map<std::string, int>
78 getPrimaryVarMeaningMap(
const std::string& variable)
const;
82 using PyCArray = py::array_t<double, py::array::c_style | py::array::forcecast>;
84 void setPorosity(PyCArray array);
86 void setPrimaryVariable(
const std::string& idx_name,
89 void setupMpi(
bool init_mpi,
bool finalize_mpi);
99 const std::string deck_filename_{};
100 bool has_run_init_{
false};
101 bool has_run_cleanup_{
false};
102 bool mpi_init_{
true};
103 bool mpi_finalize_{
true};
109 std::unique_ptr<PyMain<TypeTag>> main_{};
110 std::unique_ptr<FlowMain<TypeTag>> flow_main_{};
111 Simulator* simulator_{
nullptr};
112 std::unique_ptr<PyFluidState<TypeTag>> fluid_state_{};
113 std::unique_ptr<PyMaterialState<TypeTag>> material_state_{};
114 std::shared_ptr<Deck> deck_{};
115 std::shared_ptr<EclipseState> eclipse_state_{};
116 std::shared_ptr<Schedule> schedule_{};
117 std::shared_ptr<SummaryConfig> summary_config_{};
118 std::vector<std::string> args_{};
123 #include <opm/simulators/flow/python/PyBaseSimulator_impl.hpp> 125 #endif // OPM_PY_BASE_SIMULATOR_HEADER_INCLUDED typename Properties::Detail::GetPropImpl< TypeTag, Property >::type::type GetPropType
get the type alias defined in the property (equivalent to old macro GET_PROP_TYPE(...))
Definition: propertysystem.hh:233
This file provides the infrastructure to retrieve run-time parameters.
Definition: FlowMain.hpp:66
Definition: PyMaterialState.hpp:33
Definition: PyBaseSimulator.hpp:44
The Opm property system, traits with inheritance.
Definition: PyBaseSimulator.hpp:41
Definition: PyFluidState.hpp:36