fix(python-bindings): Updated python bindings to new interface

The python bindings now work with the polymorphic reaction class and the CVODE solver
This commit is contained in:
2025-10-30 15:05:08 -04:00
parent 23df87f915
commit 7fded59814
27 changed files with 962 additions and 255 deletions

View File

@@ -302,6 +302,8 @@ namespace gridfire {
[[nodiscard]] std::vector<double> mapNetInToMolarAbundanceVector(const NetIn &netIn) const override;
[[nodiscard]] PrimingReport primeEngine(const NetIn &netIn) override;
fourdst::composition::Composition collectComposition(fourdst::composition::Composition &comp) const override;
private:
using Config = fourdst::config::Config;
using LogManager = fourdst::logging::LogManager;
@@ -315,6 +317,7 @@ namespace gridfire {
/** @brief The set of species that are currently active in the network. */
std::vector<fourdst::atomic::Species> m_activeSpecies;
/** @brief The set of reactions that are currently active in the network. */
reaction::ReactionSet m_activeReactions;

View File

@@ -220,6 +220,8 @@ namespace gridfire{
[[nodiscard]] std::vector<double> mapNetInToMolarAbundanceVector(const NetIn &netIn) const override;
[[nodiscard]] PrimingReport primeEngine(const NetIn &netIn) override;
fourdst::composition::Composition collectComposition(fourdst::composition::Composition &comp) const override;
protected:
bool m_isStale = true;
GraphEngine& m_baseEngine;

View File

@@ -650,7 +650,7 @@ namespace gridfire {
* @brief Exports the network to a DOT file for visualization.
*
* @param filename The name of the DOT file to create.
* @param Y Vector of current molar abundances for the full network.
* @param comp Composition object
* @param T9 Temperature in units of 10^9 K.
* @param rho Density in g/cm^3.
*
@@ -663,7 +663,7 @@ namespace gridfire {
*/
void exportToDot(
const std::string& filename,
const fourdst::composition::Composition &Y,
const fourdst::composition::Composition &comp,
double T9,
double rho
) const;
@@ -784,6 +784,16 @@ namespace gridfire {
bool involvesSpeciesInDynamic(const fourdst::atomic::Species &species) const;
/**
* @brief Collect the composition from this and sub engines.
* @details This method operates by injecting the current equilibrium abundances for algebraic species into
* the composition object so that they can be bubbled up to the caller.
* @param comp Input Composition
* @return New composition which is comp + any edits from lower levels + the equilibrium abundances of all algebraic species.
* @throws BadCollectionError: if there is a species in the algebraic species set which does not show up in the reported composition from the base engine.:w
*/
fourdst::composition::Composition collectComposition(fourdst::composition::Composition &comp) const override;
private:
/**