GridFire 0.0.1a
General Purpose Nuclear Network
Loading...
Searching...
No Matches
bindings.cpp
Go to the documentation of this file.
1#include <pybind11/pybind11.h>
2#include <pybind11/stl.h> // Needed for vectors, maps, sets, strings
3#include <pybind11/stl_bind.h> // Needed for binding std::vector, std::map etc if needed directly
4
5#include <string_view>
6#include <vector>
7
8#include "bindings.h"
9
12
13namespace py = pybind11;
14
15void register_screening_bindings(py::module &m) {
16 py::class_<gridfire::screening::ScreeningModel, PyScreening>(m, "ScreeningModel");
17
18 py::enum_<gridfire::screening::ScreeningType>(m, "ScreeningType")
21 .export_values();
22
23 m.def("selectScreeningModel", &gridfire::screening::selectScreeningModel,
24 py::arg("type"),
25 "Select a screening model based on the specified type. Returns a pointer to the selected model.");
26
27 py::class_<gridfire::screening::BareScreeningModel>(m, "BareScreeningModel")
28 .def(py::init<>())
29 .def("calculateScreeningFactors",
30 py::overload_cast<const gridfire::reaction::LogicalReactionSet&, const std::vector<fourdst::atomic::Species>&, const std::vector<double>&, double, double>(&gridfire::screening::BareScreeningModel::calculateScreeningFactors, py::const_),
31 py::arg("reactions"), py::arg("species"), py::arg("Y"), py::arg("T9"), py::arg("rho"),
32 "Calculate the bare plasma screening factors. This always returns 1.0 (bare)"
33 );
34
35 py::class_<gridfire::screening::WeakScreeningModel>(m, "WeakScreeningModel")
36 .def(py::init<>())
37 .def("calculateScreeningFactors",
38 py::overload_cast<const gridfire::reaction::LogicalReactionSet&, const std::vector<fourdst::atomic::Species>&, const std::vector<double>&, double, double>(&gridfire::screening::WeakScreeningModel::calculateScreeningFactors, py::const_),
39 py::arg("reactions"), py::arg("species"), py::arg("Y"), py::arg("T9"), py::arg("rho"),
40 "Calculate the weak plasma screening factors using the Salpeter (1954) model."
41 );
42}
std::vector< double > calculateScreeningFactors(const reaction::LogicalReactionSet &reactions, const std::vector< fourdst::atomic::Species > &species, const std::vector< double > &Y, const double T9, const double rho) const override
Calculates screening factors, which are always 1.0.
std::vector< double > calculateScreeningFactors(const reaction::LogicalReactionSet &reactions, const std::vector< fourdst::atomic::Species > &species, const std::vector< double > &Y, const double T9, const double rho) const override
Calculates weak screening factors for a set of reactions.
TemplatedReactionSet< LogicalReaction > LogicalReactionSet
A set of logical reactions.
Definition reaction.h:563
std::unique_ptr< ScreeningModel > selectScreeningModel(ScreeningType type)
A factory function to select and create a screening model.
@ WEAK
Weak screening model (Salpeter, 1954).
@ BARE
No screening applied. The screening factor is always 1.0.
void register_screening_bindings(py::module &m)
Definition bindings.cpp:15