OGS
PythonSourceTermModule.cpp
Go to the documentation of this file.
1
12
13#include <algorithm>
14#include <pybind11/pybind11.h>
15#include <pybind11/stl.h>
16
18
19namespace ProcessLib
20{
21namespace SourceTerms
22{
23namespace Python
24{
30{
31public:
33 PythonSourceTermPythonSideInterface;
34
35 std::pair<double, std::vector<double>> getFlux(
36 double t, std::array<double, 3> const& x,
37 std::vector<double> const& primary_variables) const override
38 {
39 using Ret = std::pair<double, std::vector<double>>;
40 PYBIND11_OVERLOAD_PURE(Ret, PythonSourceTermPythonSideInterface,
41 getFlux, t, x, primary_variables);
42 }
43};
44
45void pythonBindSourceTerm(pybind11::module& m)
46{
47 namespace py = pybind11;
48
51 pybc(m, "SourceTerm");
52
53 pybc.def(py::init());
54
56}
57
58} // namespace Python
59} // namespace SourceTerms
60} // 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.