SERiF 0.0.1a
3+1D Stellar Structure and Evolution
Loading...
Searching...
No Matches
bindings.h File Reference

Declares the function to register polytrope module C++ components with pybind11. More...

#include <pybind11/pybind11.h>

Go to the source code of this file.

Functions

void register_polytrope_bindings (pybind11::module &polytrope_submodule)
 Registers C++ classes and functions from the serif::polytrope namespace to Python.
 

Detailed Description

Declares the function to register polytrope module C++ components with pybind11.

This file contains the declaration for register_polytrope_bindings, which is responsible for creating Python bindings for classes and functions within the serif::polytrope C++ namespace. These bindings will be accessible in Python under the serif.polytrope submodule.

Definition in file bindings.h.

Function Documentation

◆ register_polytrope_bindings()

void register_polytrope_bindings ( pybind11::module & polytrope_submodule)

Registers C++ classes and functions from the serif::polytrope namespace to Python.

This function takes a pybind11::module object, representing the serif.polytrope Python submodule, and adds bindings for various components like PolytropeOperator, PolySolver, etc. This allows these C++ components to be instantiated and used directly from Python.

Parameters
polytrope_submoduleThe pybind11 module (typically serif.polytrope) to which the polytrope C++ bindings will be added.
Python Usage Example:
After these bindings are registered and the Python module is imported:
from serif.polytrope import PolySolver
polytrope = PolySolver(1.5, 1)
polytrope.solve()

Definition at line 14 of file bindings.cpp.