File: simulation_config.cpp

package info (click to toggle)
opm-common 2025.10%2Bds-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 96,952 kB
  • sloc: cpp: 291,772; python: 3,609; sh: 198; xml: 174; pascal: 136; makefile: 12
file content (27 lines) | stat: -rw-r--r-- 1,596 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#include <opm/input/eclipse/EclipseState/SimulationConfig/SimulationConfig.hpp>

#include "export.hpp"

#include <python/cxx/OpmCommonPythonDoc.hpp>

/**
 * @brief Function to export the SimulationConfig class and some methods to Python.
 *
 * In the below class we use std::shared_ptr as the holder type, see https://pybind11.readthedocs.io/en/stable/advanced/smart_ptrs.html
 * this makes it possible to share the SimulationConfig (which is created only once per simulation) with e.g. the opm.simulators.BlackOilSimulator Python object.
 *
 * @param module Reference to the python module.
 */
void python::common::export_SimulationConfig(py::module& module)
{
    using namespace Opm::Common::DocStrings;

    py::class_< SimulationConfig , std::shared_ptr<SimulationConfig>>( module, "SimulationConfig", SimulationConfig_docstring)
        .def("hasThresholdPressure", &SimulationConfig::useThresholdPressure, SimulationConfig_hasThresholdPressure_docstring )
        .def("useCPR",               &SimulationConfig::useCPR, SimulationConfig_useCPR_docstring )
        .def("useNONNC",             &SimulationConfig::useNONNC, SimulationConfig_useNONNC_docstring )
        .def("hasDISGAS",            &SimulationConfig::hasDISGAS, SimulationConfig_hasDISGAS_docstring )
        .def("hasDISGASW",           &SimulationConfig::hasDISGASW, SimulationConfig_hasDISGASW_docstring )
        .def("hasVAPOIL",            &SimulationConfig::hasVAPOIL, SimulationConfig_hasVAPOIL_docstring )
        .def("hasVAPWAT",            &SimulationConfig::hasVAPWAT, SimulationConfig_hasVAPWAT_docstring );
}