8#include "fourdst/config/config.h"
9#include "fourdst/logging/logging.h"
11#include "quill/Logger.h"
20 const std::string& fileName,
32 const std::vector<double>& Y_defined,
37 const std::vector<double>& Y_defined,
47 const int speciesIndex_defined,
48 const int reactionIndex_defined
52 const std::vector<double>& Y_defined,
58 const std::vector<double>& Y_defined,
71 using Config = fourdst::config::Config;
74 quill::Logger*
m_logger = LogManager::getInstance().getLogger(
"log");
122 std::vector<double>
mapViewToFull(
const std::vector<double>& culled)
const;
131 std::vector<double>
mapFullToView(
const std::vector<double>& full)
const;
Abstract class for engines supporting Jacobian and stoichiometry operations.
Abstract base class for a "view" of a reaction network engine.
const io::NetworkFileParser & m_parser
Parser for the network file.
double getJacobianMatrixEntry(const int i_defined, const int j_defined) const override
Get an entry from the previously generated Jacobian matrix.
std::string m_fileName
Name of the file defining the reaction set considered by the engine view.
void generateStoichiometryMatrix() override
Generate the stoichiometry matrix for the network.
std::vector< fourdst::atomic::Species > m_activeSpecies
Active species in the defined engine.
StepDerivatives< double > calculateRHSAndEnergy(const std::vector< double > &Y_defined, const double T9, const double rho) const override
Calculate the right-hand side (dY/dt) and energy generation.
void buildFromFile(const std::string &fileName)
void generateJacobianMatrix(const std::vector< double > &Y_defined, const double T9, const double rho) override
Generate the Jacobian matrix for the current state.
const DynamicEngine & getBaseEngine() const override
Access the underlying engine instance.
std::vector< size_t > constructSpeciesIndexMap() const
Constructs the species index map.
const reaction::LogicalReactionSet & getNetworkReactions() const override
Get the set of logical reactions in the network.
fourdst::config::Config Config
const std::vector< fourdst::atomic::Species > & getNetworkSpecies() const override
Get the list of species in the network.
size_t mapViewToFullSpeciesIndex(size_t culledSpeciesIndex) const
Maps a culled species index to a full species index.
FileDefinedEngineView(DynamicEngine &baseEngine, const std::string &fileName, const io::NetworkFileParser &parser)
void setNetworkFile(const std::string &fileName)
std::vector< double > mapFullToView(const std::vector< double > &full) const
Maps a vector of full abundances to a vector of culled abundances.
int getStoichiometryMatrixEntry(const int speciesIndex_defined, const int reactionIndex_defined) const override
Get an entry from the stoichiometry matrix.
std::vector< double > mapViewToFull(const std::vector< double > &culled) const
Maps a vector of culled abundances to a vector of full abundances.
double calculateMolarReactionFlow(const reaction::Reaction &reaction, const std::vector< double > &Y_defined, const double T9, const double rho) const override
Calculate the molar reaction flow for a given reaction.
fourdst::logging::LogManager LogManager
void update(const NetIn &netIn) override
std::unordered_map< fourdst::atomic::Species, double > getSpeciesTimescales(const std::vector< double > &Y_defined, const double T9, const double rho) const override
Compute timescales for all species in the network.
DynamicEngine & m_baseEngine
void setScreeningModel(screening::ScreeningType model) override
screening::ScreeningType getScreeningModel() const override
reaction::LogicalReactionSet m_activeReactions
Active reactions in the defined engine.
void validateNetworkState() const
size_t mapViewToFullReactionIndex(size_t culledReactionIndex) const
Maps a culled reaction index to a full reaction index.
std::vector< size_t > constructReactionIndexMap() const
Constructs the reaction index map.
std::vector< size_t > m_speciesIndexMap
Maps indices of active species to indices in the full network.
std::vector< size_t > m_reactionIndexMap
Maps indices of active reactions to indices in the full network.
Represents a single nuclear reaction from a specific data source.
Abstract interfaces for reaction network engines in GridFire.
Abstract interfaces for engine "views" in GridFire.
TemplatedReactionSet< LogicalReaction > LogicalReactionSet
A set of logical reactions.
Structure holding derivatives and energy generation for a network step.