feat(python): added robust python bindings covering the entire codebase
This commit is contained in:
31
src/lib/screening/screening_bare.cpp
Normal file
31
src/lib/screening/screening_bare.cpp
Normal 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);
|
||||
}
|
||||
}
|
||||
19
src/lib/screening/screening_types.cpp
Normal file
19
src/lib/screening/screening_types.cpp
Normal 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>();
|
||||
}
|
||||
}
|
||||
}
|
||||
31
src/lib/screening/screening_weak.cpp
Normal file
31
src/lib/screening/screening_weak.cpp
Normal 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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user