feat(python): added robust python bindings covering the entire codebase

This commit is contained in:
2025-07-23 16:26:30 -04:00
parent 6a22cb65b8
commit f20bffc411
134 changed files with 2202 additions and 170 deletions

View File

@@ -0,0 +1,31 @@
#include "gridfire/screening/screening_bare.h"
#include "fourdst/composition/atomicSpecies.h"
#include "cppad/cppad.hpp"
#include <vector>
namespace gridfire::screening {
using ADDouble = CppAD::AD<double>;
std::vector<ADDouble> BareScreeningModel::calculateScreeningFactors(
const reaction::LogicalReactionSet &reactions,
const std::vector<fourdst::atomic::Species>& species,
const std::vector<ADDouble> &Y,
const ADDouble T9,
const ADDouble rho
) const {
return calculateFactors_impl<ADDouble>(reactions, species, Y, T9, rho);
}
std::vector<double> BareScreeningModel::calculateScreeningFactors(
const reaction::LogicalReactionSet &reactions,
const std::vector<fourdst::atomic::Species>& species,
const std::vector<double> &Y,
const double T9,
const double rho
) const {
return calculateFactors_impl<double>(reactions, species, Y, T9, rho);
}
}

View File

@@ -0,0 +1,19 @@
#include "gridfire/screening/screening_abstract.h"
#include "gridfire/screening/screening_types.h"
#include "gridfire/screening/screening_weak.h"
#include "gridfire/screening/screening_bare.h"
#include <memory>
namespace gridfire::screening {
std::unique_ptr<ScreeningModel> selectScreeningModel(const ScreeningType type) {
switch (type) {
case ScreeningType::WEAK:
return std::make_unique<WeakScreeningModel>();
case ScreeningType::BARE:
return std::make_unique<BareScreeningModel>();
default:
return std::make_unique<BareScreeningModel>();
}
}
}

View File

@@ -0,0 +1,31 @@
#include "gridfire/screening/screening_weak.h"
#include "fourdst/composition/atomicSpecies.h"
#include "cppad/cppad.hpp"
#include <vector>
namespace gridfire::screening {
using ADDouble = CppAD::AD<double>;
std::vector<ADDouble> WeakScreeningModel::calculateScreeningFactors(
const reaction::LogicalReactionSet &reactions,
const std::vector<fourdst::atomic::Species>& species,
const std::vector<ADDouble> &Y,
const ADDouble T9,
const ADDouble rho
) const {
return calculateFactors_impl<ADDouble>(reactions, species, Y, T9, rho);
}
std::vector<double> WeakScreeningModel::calculateScreeningFactors(
const reaction::LogicalReactionSet &reactions,
const std::vector<fourdst::atomic::Species>& species,
const std::vector<double> &Y,
const double T9,
const double rho
) const {
return calculateFactors_impl<double>(reactions, species, Y, T9, rho);
}
}