OGS
PythonSourceTermModule.cpp
Go to the documentation of this file.
1
12
13#include <pybind11/pybind11.h>
14#include <pybind11/stl.h>
15
17
18namespace ProcessLib
19{
20namespace SourceTerms
21{
22namespace Python
23{
29{
30public:
32 PythonSourceTermPythonSideInterface;
33
34 std::pair<double, std::vector<double>> getFlux(
35 double t, std::array<double, 3> const& x,
36 std::vector<double> const& primary_variables) const override
37 {
38 using Ret = std::pair<double, std::vector<double>>;
39 PYBIND11_OVERLOAD_PURE(Ret, PythonSourceTermPythonSideInterface,
40 getFlux, t, x, primary_variables);
41 }
42};
43
44void pythonBindSourceTerm(pybind11::module& m)
45{
46 namespace py = pybind11;
47
50 pybc(m, "SourceTerm");
51
52 pybc.def(py::init());
53
55}
56
57} // namespace Python
58} // namespace SourceTerms
59} // namespace ProcessLib
std::pair< double, std::vector< double > > getFlux(double t, std::array< double, 3 > const &x, std::vector< double > const &primary_variables) const override
virtual std::pair< double, std::vector< double > > getFlux(double, std::array< double, 3 > const &, std::vector< double > const &) const =0
void pythonBindSourceTerm(pybind11::module &m)
Creates Python bindings for the Python source term class.