OGS
PythonBoundaryConditionModule.cpp
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) OpenGeoSys Community (opengeosys.org)
2// SPDX-License-Identifier: BSD-3-Clause
3
5
6#include <pybind11/stl.h>
7
9
10namespace ProcessLib
11{
17{
18public:
20 PythonBoundaryConditionPythonSideInterface;
21
22 std::pair<bool, double> getDirichletBCValue(
23 double t, std::array<double, 3> x, std::size_t node_id,
24 std::vector<double> const& primary_variables) const override
25 {
26 using Ret = std::pair<bool, double>;
27 PYBIND11_OVERLOAD(Ret, PythonBoundaryConditionPythonSideInterface,
28 getDirichletBCValue, t, x, node_id,
29 primary_variables);
30 }
31
32 std::tuple<bool, double, std::vector<double>> getFlux(
33 double t, std::array<double, 3> x,
34 std::vector<double> const& primary_variables) const override
35 {
36 using Ret = std::tuple<bool, double, std::vector<double>>;
37 PYBIND11_OVERLOAD(Ret, PythonBoundaryConditionPythonSideInterface,
38 getFlux, t, x, primary_variables);
39 }
40};
41
42void pythonBindBoundaryCondition(pybind11::module& m)
43{
44 namespace py = pybind11;
45
48 pybc(m, "BoundaryCondition");
49
50 pybc.def(py::init());
51
52 pybc.def("getDirichletBCValue",
55}
56
57} // namespace ProcessLib
std::tuple< bool, double, std::vector< double > > getFlux(double t, std::array< double, 3 > x, std::vector< double > const &primary_variables) const override
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
virtual std::pair< bool, double > getDirichletBCValue(double, std::array< double, 3 >, std::size_t, std::vector< double > const &) const
virtual std::tuple< bool, double, std::vector< double > > getFlux(double, std::array< double, 3 >, std::vector< double > const &) const
void pythonBindBoundaryCondition(pybind11::module &m)
Creates Python bindings for the Python BC class.