|
GridFire v0.7.1_rc2
General Purpose Nuclear Network
|
#include <engine_defined.h>
Public Member Functions | |
| DefinedEngineView (const std::vector< std::string > &peNames, GraphEngine &baseEngine) | |
| const DynamicEngine & | getBaseEngine () const override |
| Get the base engine associated with this defined engine view. | |
| const std::vector< fourdst::atomic::Species > & | getNetworkSpecies () const override |
| Gets the list of active species in the network defined by the file. | |
| std::expected< StepDerivatives< double >, engine::EngineStatus > | calculateRHSAndEnergy (const fourdst::composition::CompositionAbstract &comp, double T9, double rho) const override |
| Calculates the right-hand side (dY/dt) and energy generation for the active species. | |
| EnergyDerivatives | calculateEpsDerivatives (const fourdst::composition::CompositionAbstract &comp, double T9, double rho) const override |
| Calculate the derivatives of the energy generation rate with respect to T and rho. | |
| NetworkJacobian | generateJacobianMatrix (const fourdst::composition::CompositionAbstract &comp, double T9, double rho) const override |
| Generates the Jacobian matrix for the active species. | |
| NetworkJacobian | generateJacobianMatrix (const fourdst::composition::CompositionAbstract &comp, double T9, double rho, const std::vector< fourdst::atomic::Species > &activeSpecies) const override |
| Generates the Jacobian matrix for the active species. | |
| NetworkJacobian | generateJacobianMatrix (const fourdst::composition::CompositionAbstract &comp, double T9, double rho, const SparsityPattern &sparsityPattern) const override |
| Generates the Jacobian matrix for a given sparsity pattern. | |
| void | generateStoichiometryMatrix () override |
| Generates the stoichiometry matrix for the active reactions and species. | |
| int | getStoichiometryMatrixEntry (const fourdst::atomic::Species &species, const reaction::Reaction &reaction) const override |
| Gets an entry from the stoichiometry matrix for the active species and reactions. | |
| double | calculateMolarReactionFlow (const reaction::Reaction &reaction, const fourdst::composition::CompositionAbstract &comp, double T9, double rho) const override |
| Calculates the molar reaction flow for a given reaction in the active network. | |
| const reaction::ReactionSet & | getNetworkReactions () const override |
| Gets the set of active logical reactions in the network. | |
| void | setNetworkReactions (const reaction::ReactionSet &reactions) override |
| Sets the active reactions in the network. | |
| std::expected< std::unordered_map< fourdst::atomic::Species, double >, engine::EngineStatus > | getSpeciesTimescales (const fourdst::composition::CompositionAbstract &comp, double T9, double rho) const override |
| Computes timescales for all active species in the network. | |
| std::expected< std::unordered_map< fourdst::atomic::Species, double >, engine::EngineStatus > | getSpeciesDestructionTimescales (const fourdst::composition::CompositionAbstract &comp, double T9, double rho) const override |
| Computes destruction timescales for all active species in the network. | |
| fourdst::composition::Composition | update (const NetIn &netIn) override |
| Updates the engine view if it is marked as stale. | |
| bool | isStale (const NetIn &netIn) override |
| Checks if the engine view is stale. | |
| void | setScreeningModel (screening::ScreeningType model) override |
| Sets the screening model for the base engine. | |
| screening::ScreeningType | getScreeningModel () const override |
| Gets the screening model from the base engine. | |
| size_t | getSpeciesIndex (const fourdst::atomic::Species &species) const override |
| Maps a species from the full network to its index in the defined active network. | |
| std::vector< double > | mapNetInToMolarAbundanceVector (const NetIn &netIn) const override |
| Map from a NetIn object to a vector of molar abundances for the active species. | |
| PrimingReport | primeEngine (const NetIn &netIn) override |
| Prime the engine view for calculations. This will delegate to the base engine. | |
| fourdst::composition::Composition | collectComposition (const fourdst::composition::CompositionAbstract &comp, double T9, double rho) const override |
| Collects a Composition object from the base engine. | |
| SpeciesStatus | getSpeciesStatus (const fourdst::atomic::Species &species) const override |
| Gets the status of a species in the active network. | |
Public Member Functions inherited from gridfire::engine::DynamicEngine | |
| virtual BuildDepthType | getDepth () const |
| Get the depth of the network. | |
| virtual void | rebuild (const fourdst::composition::CompositionAbstract &comp, BuildDepthType depth) |
| Rebuild the network with a specified depth. | |
Public Member Functions inherited from gridfire::engine::Engine | |
| virtual | ~Engine ()=default |
| Virtual destructor. | |
Public Member Functions inherited from gridfire::engine::EngineView< DynamicEngine > | |
| virtual | ~EngineView ()=default |
| Virtual destructor. | |
Protected Attributes | |
| bool | m_isStale = true |
| GraphEngine & | m_baseEngine |
Private Member Functions | |
| std::vector< size_t > | constructSpeciesIndexMap () const |
| Constructs the species index map. | |
| std::vector< size_t > | constructReactionIndexMap () const |
| Constructs the reaction index map. | |
| std::vector< double > | mapViewToFull (const std::vector< double > &defined) const |
| Maps a vector of culled abundances to a vector of full abundances. | |
| std::vector< double > | mapFullToView (const std::vector< double > &full) const |
| Maps a vector of full abundances to a vector of culled abundances. | |
| size_t | mapViewToFullSpeciesIndex (size_t definedSpeciesIndex) const |
| Maps a culled species index to a full species index. | |
| size_t | mapViewToFullReactionIndex (size_t definedReactionIndex) const |
| Maps a culled reaction index to a full reaction index. | |
| void | validateNetworkState () const |
| void | collect (const std::vector< std::string > &peNames) |
Private Attributes | |
| quill::Logger * | m_logger = fourdst::logging::LogManager::getInstance().getLogger("log") |
| Active species in the defined engine. | |
| std::set< fourdst::atomic::Species > | m_activeSpecies |
| Cache for the active species vector to avoid dangling references. | |
| std::optional< std::vector< fourdst::atomic::Species > > | m_activeSpeciesVectorCache = std::nullopt |
| Active reactions in the defined engine. | |
| reaction::ReactionSet | m_activeReactions |
| Maps indices of active species to indices in the full network. | |
| std::vector< size_t > | m_speciesIndexMap |
| Maps indices of active reactions to indices in the full network. | |
| std::vector< size_t > | m_reactionIndexMap |
| gridfire::engine::DefinedEngineView::DefinedEngineView | ( | const std::vector< std::string > & | peNames, |
| GraphEngine & | baseEngine | ||
| ) |
|
overridevirtual |
Calculate the derivatives of the energy generation rate with respect to T and rho.
| comp | Composition object containing current abundances. |
| T9 | Temperature in units of 10^9 K. |
| rho | Density in g/cm^3. |
This method computes the partial derivatives of the specific nuclear energy generation rate with respect to temperature and density for the current state.
Implements gridfire::engine::DynamicEngine.
|
overridevirtual |
Calculates the molar reaction flow for a given reaction in the active network.
| reaction | The reaction for which to calculate the flow. |
| comp | A Composition object containing the current composition of the system |
| T9 | Temperature in units of 10^9 K. |
| rho | Density in g/cm^3. |
| std::runtime_error | If the view is stale or if the reaction is not in the active set. |
Implements gridfire::engine::DynamicEngine.
|
overridevirtual |
Calculates the right-hand side (dY/dt) and energy generation for the active species.
| comp | A Composition object containing the current composition of the system |
| T9 | The temperature in units of 10^9 K. |
| rho | The density in g/cm^3. |
| std::runtime_error | If the view is stale (i.e., update() has not been called after setNetworkFile()). |
Implements gridfire::engine::Engine.
|
private |
|
overridevirtual |
Collects a Composition object from the base engine.
| comp | The full Composition object. |
| T9 | The temperature in units of 10^9 K. |
| rho | The density in g/cm^3. |
Implements gridfire::engine::DynamicEngine.
|
private |
Constructs the reaction index map.
This method creates a map from the indices of the active reactions to the indices of the corresponding reactions in the full network.
| std::runtime_error | If an active reaction is not found in the base engine's reaction list. |
|
private |
Constructs the species index map.
This method creates a map from the indices of the active species to the indices of the corresponding species in the full network.
| std::runtime_error | If an active species is not found in the base engine's species list. |
|
overridevirtual |
Generates the Jacobian matrix for the active species.
| comp | A Composition object containing the current composition of the system |
| T9 | The temperature in units of 10^9 K. |
| rho | The density in g/cm^3. |
| std::runtime_error | If the view is stale. |
Implements gridfire::engine::DynamicEngine.
|
overridevirtual |
Generates the Jacobian matrix for a given sparsity pattern.
| comp | A Composition object containing the current composition of the system |
| T9 | The temperature in units of 10^9 K. |
| rho | The density in g/cm^3. |
| sparsityPattern | The sparsity pattern to use for the Jacobian matrix. |
| std::runtime_error | If the view is stale. |
Implements gridfire::engine::DynamicEngine.
|
overridevirtual |
Generates the Jacobian matrix for the active species.
| comp | A Composition object containing the current composition of the system |
| T9 | The temperature in units of 10^9 K. |
| rho | The density in g/cm^3. |
| activeSpecies | The vector of active species to include in the Jacobian. |
| std::runtime_error | If the view is stale. |
Implements gridfire::engine::DynamicEngine.
|
overridevirtual |
Generates the stoichiometry matrix for the active reactions and species.
| std::runtime_error | If the view is stale. |
Implements gridfire::engine::DynamicEngine.
|
overridevirtual |
Get the base engine associated with this defined engine view.
Implements gridfire::engine::EngineView< DynamicEngine >.
|
overridevirtual |
Gets the set of active logical reactions in the network.
| std::runtime_error | If the view is stale. |
Implements gridfire::engine::DynamicEngine.
|
overridevirtual |
Gets the list of active species in the network defined by the file.
Implements gridfire::engine::Engine.
|
overridevirtual |
Gets the screening model from the base engine.
Implements gridfire::engine::DynamicEngine.
|
overridevirtual |
Computes destruction timescales for all active species in the network.
| comp | A Composition object containing the current composition of the system |
| T9 | Temperature in units of 10^9 K. |
| rho | Density in g/cm^3. |
| std::runtime_error | If the view is stale. |
Implements gridfire::engine::DynamicEngine.
|
overridevirtual |
Maps a species from the full network to its index in the defined active network.
| species | The species to map. |
| std::runtime_error | If the species is not in the active set. |
Implements gridfire::engine::DynamicEngine.
|
overridevirtual |
Gets the status of a species in the active network.
| species | The species for which to get the status. |
Implements gridfire::engine::DynamicEngine.
|
overridevirtual |
Computes timescales for all active species in the network.
| comp | A Composition object containing the current composition of the system |
| T9 | Temperature in units of 10^9 K. |
| rho | Density in g/cm^3. |
| std::runtime_error | If the view is stale. |
Implements gridfire::engine::DynamicEngine.
|
overridevirtual |
Gets an entry from the stoichiometry matrix for the active species and reactions.
| species | The species for which to get the stoichiometric coefficient. |
| reaction | The reaction for which to get the stoichiometric coefficient. |
| std::runtime_error | If the view is stale. |
| std::out_of_range | If an index is out of bounds. |
Implements gridfire::engine::DynamicEngine.
|
overridevirtual |
Checks if the engine view is stale.
| netIn | The current network input (unused). |
Implements gridfire::engine::DynamicEngine.
|
private |
Maps a vector of full abundances to a vector of culled abundances.
| full | A vector of abundances for the full network. |
|
overridevirtual |
Map from a NetIn object to a vector of molar abundances for the active species.
| netIn | The NetIn object containing the full network abundances. |
Implements gridfire::engine::DynamicEngine.
|
private |
Maps a vector of culled abundances to a vector of full abundances.
| defined | A vector of abundances for the active species. |
|
private |
Maps a culled reaction index to a full reaction index.
| definedReactionIndex | The index of the reaction in the defined reaction list. |
| std::out_of_range | If the defined index is out of bounds for the reaction index map. |
|
private |
Maps a culled species index to a full species index.
| definedSpeciesIndex | The index of the species in the defined species list. |
| std::out_of_range | If the defined index is out of bounds for the species index map. |
|
overridevirtual |
Prime the engine view for calculations. This will delegate to the base engine.
| netIn | The current network input. |
Implements gridfire::engine::DynamicEngine.
|
overridevirtual |
Sets the active reactions in the network.
| reactions | The ReactionSet containing the reactions to set as active. |
Implements gridfire::engine::DynamicEngine.
|
overridevirtual |
Sets the screening model for the base engine.
| model | The screening model to set. |
Implements gridfire::engine::DynamicEngine.
|
overridevirtual |
Updates the engine view if it is marked as stale.
This method checks if the view is stale (e.g., after setNetworkFile was called). If it is, it rebuilds the active network from the currently set file. The netIn parameter is not used by this implementation but is required by the interface.
| netIn | The current network input (unused). |
Implements gridfire::engine::DynamicEngine.
|
private |
|
private |
Maps indices of active species to indices in the full network.
|
private |
Cache for the active species vector to avoid dangling references.
|
mutableprivate |
Active reactions in the defined engine.
|
protected |
|
protected |
|
private |
Active species in the defined engine.
Logger instance for trace and debug information.
|
private |
|
private |
Maps indices of active reactions to indices in the full network.