OGS
ApplicationsLib Namespace Reference

Detailed Description

The LinearSolverLibrarySetup takes care of proper initialization and shutting down of an external linear solver library. The concrete implementation is chosen by the build system. An object of this class must be created at the beginning of the scope where it is used. When the scope closes (or the object is destroyed explicitly) library shutting down functions are automatically called. The default implementation is empty providing polymorphic behaviour when using this class.

Classes

struct  LinearSolverLibrarySetup
 
class  TestDefinition
 

Functions

pybind11::scoped_interpreter setupEmbeddedPython ()
 

Function Documentation

◆ setupEmbeddedPython()

OGS_EXPORT_SYMBOL pybind11::scoped_interpreter ApplicationsLib::setupEmbeddedPython ( )

Sets up an embedded Python interpreter and makes sure that the OpenGeoSys Python module is not removed by the linker.

Definition at line 59 of file ogs_embedded_python.cpp.

60{
61#ifndef OGS_BUILD_SHARED_LIBS
62 // pybind11_init_impl_OpenGeoSys is the function initializing the embedded
63 // OpenGeoSys Python module. The name is generated by pybind11. If it is not
64 // obvious that this symbol is actually used, the linker might remove it
65 // under certain circumstances.
66 mark_used(&pybind11_init_impl_OpenGeoSys);
67#endif
68
69 // Allows ogs to be interrupted by SIGINT, which otherwise is handled by
70 // python. See
71 // https://docs.python.org/3/c-api/exceptions.html#c.PyErr_CheckSignals and
72 // https://pybind11.readthedocs.io/en/stable/faq.html#how-can-i-properly-handle-ctrl-c-in-long-running-functions
73 constexpr bool init_signal_handlers = false;
74 return pybind11::scoped_interpreter{init_signal_handlers};
75}
void mark_used(T p)

References mark_used().