OGS
BHEInflowPythonBoundaryConditionModule.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 BHEInflowPythonBoundaryConditionPythonSideInterface;
21
22 std::tuple<double, std::vector<double>, std::vector<double>,
23 std::vector<int>, std::vector<double>>
24 initializeDataContainer() const override
25 {
26 using Ret = std::tuple<double, std::vector<double>, std::vector<double>,
27 std::vector<int>, std::vector<double>>;
28 PYBIND11_OVERLOAD(Ret,
31 }
32
33 std::tuple<bool, bool, std::vector<double>, std::vector<double>>
34 tespySolver(double t,
35 std::vector<double> const& Tin_val,
36 std::vector<double> const& Tout_val) const override
37 {
38 using Ret =
39 std::tuple<bool, bool, std::vector<double>, std::vector<double>>;
40 PYBIND11_OVERLOAD(Ret,
42 tespySolver, t, Tin_val, Tout_val);
43 }
44
45 std::tuple<std::vector<double>, std::vector<double>>
47 double const t, double const dt, std::vector<double> const& Tin_val,
48 std::vector<double> const& Tout_val,
49 std::vector<double> const& flowrate) const override
50 {
51 using Ret = std::tuple<std::vector<double>, std::vector<double>>;
52 PYBIND11_OVERLOAD(
54 serverCommunicationPreTimestep, t, dt, Tin_val, Tout_val, flowrate);
55 }
56
58 double const t, double const dt, std::vector<double> const& Tin_val,
59 std::vector<double> const& Tout_val,
60 std::vector<double> const& flowrate) const override
61 {
62 PYBIND11_OVERLOAD(void,
64 serverCommunicationPostTimestep, t, dt, Tin_val,
65 Tout_val, flowrate);
66 }
67};
68
69void bheInflowpythonBindBoundaryCondition(pybind11::module& m)
70{
71 namespace py = pybind11;
72
75 pybc(m, "BHENetwork");
76
77 pybc.def(py::init());
78
79 pybc.def("initializeDataContainer",
81 initializeDataContainer);
82 pybc.def("tespySolver",
84
85 pybc.def("serverCommunicationPreTimestep",
87 serverCommunicationPreTimestep);
88
89 pybc.def("serverCommunicationPostTimestep",
91 serverCommunicationPostTimestep);
92}
93
94} // namespace ProcessLib
std::tuple< double, std::vector< double >, std::vector< double >, std::vector< int >, std::vector< double > > initializeDataContainer() const override
std::tuple< bool, bool, std::vector< double >, std::vector< double > > tespySolver(double t, std::vector< double > const &Tin_val, std::vector< double > const &Tout_val) const override
void serverCommunicationPostTimestep(double const t, double const dt, std::vector< double > const &Tin_val, std::vector< double > const &Tout_val, std::vector< double > const &flowrate) const override
std::tuple< std::vector< double >, std::vector< double > > serverCommunicationPreTimestep(double const t, double const dt, std::vector< double > const &Tin_val, std::vector< double > const &Tout_val, std::vector< double > const &flowrate) const override
virtual std::tuple< bool, bool, std::vector< double >, std::vector< double > > tespySolver(double, std::vector< double > const &, std::vector< double > const &) const
void bheInflowpythonBindBoundaryCondition(pybind11::module &m)
Creates BHE Inflow Python bindings for the Python BC class.