OGS
ogs_callbacks_module.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
4#include <pybind11/eval.h>
5#include <pybind11/pybind11.h>
6
7#include <algorithm>
8
9#include "BaseLib/Logging.h"
13
14PYBIND11_MODULE(callbacks, m)
15{
16#ifndef NDEBUG
18#else // NDEBUG
20#endif // NDEBUG
21 m.attr("__name__") = "ogs.callbacks";
25
26 pybind11::exec(R"(
27 try:
28 import OpenGeoSys
29 raise ImportError("The Python interpreter seems to be running inside the OGS binary, but you are about to import a Python module from OGS's Python bindings. Please do not import ogs.callbacks, but use the OpenGeoSys module, instead.")
30 except ModuleNotFoundError:
31 pass
32 )");
33}
void initOGSLogger(std::string const &log_level)
Definition Logging.cpp:56
void pythonBindSourceTerm(pybind11::module &m)
Creates Python bindings for the Python source term class.
void pythonBindBoundaryCondition(pybind11::module &m)
Creates Python bindings for the Python BC class.
void bheInflowpythonBindBoundaryCondition(pybind11::module &m)
Creates BHE Inflow Python bindings for the Python BC class.
PYBIND11_MODULE(callbacks, m)