OGS
PythonBoundaryConditionModule.cpp
Go to the documentation of this file.
1 
12 
13 #include <pybind11/stl.h>
14 
16 
17 namespace ProcessLib
18 {
24 {
25 public:
26  using PythonBoundaryConditionPythonSideInterface::
27  PythonBoundaryConditionPythonSideInterface;
28 
29  std::pair<bool, double> getDirichletBCValue(
30  double t, std::array<double, 3> x, std::size_t node_id,
31  std::vector<double> const& primary_variables) const override
32  {
33  using Ret = std::pair<bool, double>;
34  PYBIND11_OVERLOAD(Ret, PythonBoundaryConditionPythonSideInterface,
35  getDirichletBCValue, t, x, node_id,
36  primary_variables);
37  }
38 
39  std::tuple<bool, double, std::vector<double>> getFlux(
40  double t, std::array<double, 3> x,
41  std::vector<double> const& primary_variables) const override
42  {
43  using Ret = std::tuple<bool, double, std::vector<double>>;
44  PYBIND11_OVERLOAD(Ret, PythonBoundaryConditionPythonSideInterface,
45  getFlux, t, x, primary_variables);
46  }
47 };
48 
49 void pythonBindBoundaryCondition(pybind11::module& m)
50 {
51  namespace py = pybind11;
52 
55  pybc(m, "BoundaryCondition");
56 
57  pybc.def(py::init());
58 
59  pybc.def("getDirichletBCValue",
62 }
63 
64 } // namespace ProcessLib
std::pair< bool, double > getDirichletBCValue(double t, std::array< double, 3 > x, std::size_t node_id, std::vector< double > const &primary_variables) const override
std::tuple< bool, double, std::vector< double > > getFlux(double t, std::array< double, 3 > x, std::vector< double > const &primary_variables) const override
virtual std::tuple< bool, double, std::vector< double > > getFlux(double, std::array< double, 3 >, std::vector< double > const &) const
virtual std::pair< bool, double > getDirichletBCValue(double, std::array< double, 3 >, std::size_t, std::vector< double > const &) const
void pythonBindBoundaryCondition(pybind11::module &m)
Creates Python bindings for the Python BC class.