6#include "fourdst/composition/atomicSpecies.h"
38 int getSpeciesIndex(
const fourdst::atomic::Species &species)
const override;
42 throw std::logic_error(
"Network depth not supported by this engine.");
45 throw std::logic_error(
"Setting network depth not supported by this engine.");
std::expected< std::unordered_map< fourdst::atomic::Species, double >, gridfire::expectations::StaleEngineError > getSpeciesDestructionTimescales(const std::vector< double > &Y, double T9, double rho) const override
std::expected< std::unordered_map< fourdst::atomic::Species, double >, gridfire::expectations::StaleEngineError > getSpeciesTimescales(const std::vector< double > &Y, double T9, double rho) const override
Compute timescales for all species in the network.
double getJacobianMatrixEntry(int i, int j) const override
Get an entry from the previously generated Jacobian matrix.
void generateStoichiometryMatrix() override
Generate the stoichiometry matrix for the network.
std::vector< fourdst::atomic::Species > m_species_cache
int getSpeciesIndex(const fourdst::atomic::Species &species) const override
void rebuild(const fourdst::composition::Composition &comp, gridfire::BuildDepthType depth) override
bool isStale(const gridfire::NetIn &netIn) override
const gridfire::reaction::LogicalReactionSet & getNetworkReactions() const override
Get the set of logical reactions in the network.
std::expected< gridfire::StepDerivatives< double >, gridfire::expectations::StaleEngineError > calculateRHSAndEnergy(const std::vector< double > &Y, double T9, double rho) const override
Calculate the right-hand side (dY/dt) and energy generation.
void generateJacobianMatrix(const std::vector< double > &Y_dynamic, double T9, double rho) const override
Generate the Jacobian matrix for the current state.
std::vector< double > mapNetInToMolarAbundanceVector(const gridfire::NetIn &netIn) const override
double calculateMolarReactionFlow(const gridfire::reaction::Reaction &reaction, const std::vector< double > &Y, double T9, double rho) const override
Calculate the molar reaction flow for a given reaction.
int getStoichiometryMatrixEntry(int speciesIndex, int reactionIndex) const override
Get an entry from the stoichiometry matrix.
gridfire::screening::ScreeningType getScreeningModel() const override
Get the current electron screening model.
gridfire::PrimingReport primeEngine(const gridfire::NetIn &netIn) override
gridfire::BuildDepthType getDepth() const override
fourdst::composition::Composition update(const gridfire::NetIn &netIn) override
Update the internal state of the engine.
void setScreeningModel(gridfire::screening::ScreeningType model) override
Set the electron screening model.
const std::vector< fourdst::atomic::Species > & getNetworkSpecies() const override
PyDynamicEngine Implementation ///.
void setNetworkReactions(const gridfire::reaction::LogicalReactionSet &reactions) override
const gridfire::DynamicEngine & getBaseEngine() const override
Access the underlying engine instance.
const std::vector< fourdst::atomic::Species > & getNetworkSpecies() const override
Get the list of species in the network.
std::expected< gridfire::StepDerivatives< double >, gridfire::expectations::StaleEngineError > calculateRHSAndEnergy(const std::vector< double > &Y, double T9, double rho) const override
Calculate the right-hand side (dY/dt) and energy generation.
std::vector< fourdst::atomic::Species > m_species_cache
const gridfire::Engine & getBaseEngine() const override
Access the underlying engine instance.
Abstract class for engines supporting Jacobian and stoichiometry operations.
Abstract base class for a reaction network engine.
Abstract base class for a "view" of a reaction network engine.
Represents a single nuclear reaction from a specific data source.
Core header for the GridFire reaction network engine module.
TemplatedReactionSet< LogicalReaction > LogicalReactionSet
A set of logical reactions.
ScreeningType
Enumerates the available plasma screening models.
std::variant< NetworkBuildDepth, int > BuildDepthType
Variant specifying either a predefined NetworkBuildDepth or a custom integer depth.
std::vector< std::pair< size_t, size_t > > SparsityPattern
Captures the result of a network priming operation.