|
GridFire 0.0.1a
General Purpose Nuclear Network
|
#include <engine_defined.h>
Public Member Functions | |
| DefinedEngineView (const std::vector< std::string > &peNames, DynamicEngine &baseEngine) | |
| const DynamicEngine & | getBaseEngine () const override |
| Access the underlying engine instance. | |
| 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 >, expectations::StaleEngineError > | calculateRHSAndEnergy (const std::vector< double > &Y_defined, const double T9, const double rho) const override |
| Calculates the right-hand side (dY/dt) and energy generation for the active species. | |
| void | generateJacobianMatrix (const std::vector< double > &Y_dynamic, const double T9, const double rho) const override |
| Generates the Jacobian matrix for the active species. | |
| double | getJacobianMatrixEntry (const int i_defined, const int j_defined) const override |
| Gets an entry from the Jacobian matrix for the active species. | |
| void | generateStoichiometryMatrix () override |
| Generates the stoichiometry matrix for the active reactions and species. | |
| int | getStoichiometryMatrixEntry (const int speciesIndex_defined, const int reactionIndex_defined) const override |
| Gets an entry from the stoichiometry matrix for the active species and reactions. | |
| double | calculateMolarReactionFlow (const reaction::Reaction &reaction, const std::vector< double > &Y_defined, const double T9, const double rho) const override |
| Calculates the molar reaction flow for a given reaction in the active network. | |
| const reaction::LogicalReactionSet & | getNetworkReactions () const override |
| Gets the set of active logical reactions in the network. | |
| void | setNetworkReactions (const reaction::LogicalReactionSet &reactions) override |
| std::expected< std::unordered_map< fourdst::atomic::Species, double >, expectations::StaleEngineError > | getSpeciesTimescales (const std::vector< double > &Y_defined, const double T9, const double rho) const override |
| Computes timescales for all active species in the network. | |
| std::expected< std::unordered_map< fourdst::atomic::Species, double >, expectations::StaleEngineError > | getSpeciesDestructionTimescales (const std::vector< double > &Y_defined, const double T9, const double rho) const override |
| fourdst::composition::Composition | update (const NetIn &netIn) override |
| Updates the engine view if it is marked as stale. | |
| bool | isStale (const NetIn &netIn) override |
| 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. | |
| int | getSpeciesIndex (const fourdst::atomic::Species &species) const override |
| std::vector< double > | mapNetInToMolarAbundanceVector (const NetIn &netIn) const override |
| PrimingReport | primeEngine (const NetIn &netIn) override |
Public Member Functions inherited from gridfire::DynamicEngine | |
| virtual void | generateJacobianMatrix (const std::vector< double > &Y_dynamic, double T9, double rho, const SparsityPattern &sparsityPattern) const |
| virtual BuildDepthType | getDepth () const |
| virtual void | rebuild (const fourdst::composition::Composition &comp, BuildDepthType depth) |
Public Member Functions inherited from gridfire::Engine | |
| virtual | ~Engine ()=default |
| Virtual destructor. | |
Public Member Functions inherited from gridfire::EngineView< DynamicEngine > | |
| virtual | ~EngineView ()=default |
| Virtual destructor. | |
Protected Attributes | |
| bool | m_isStale = true |
| DynamicEngine & | 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::vector< fourdst::atomic::Species > | m_activeSpecies |
| Active reactions in the defined engine. | |
| reaction::LogicalReactionSet | 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 |
Definition at line 16 of file engine_defined.h.
| gridfire::DefinedEngineView::DefinedEngineView | ( | const std::vector< std::string > & | peNames, |
| DynamicEngine & | baseEngine ) |
Definition at line 17 of file engine_defined.cpp.
|
overridevirtual |
Calculates the molar reaction flow for a given reaction in the active network.
| reaction | The reaction for which to calculate the flow. |
| Y_defined | Vector of current abundances for the active species. |
| 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::DynamicEngine.
Definition at line 91 of file engine_defined.cpp.
|
overridevirtual |
Calculates the right-hand side (dY/dt) and energy generation for the active species.
| Y_defined | A vector of abundances for the active species. |
| 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.
Definition at line 30 of file engine_defined.cpp.
|
private |
Definition at line 321 of file engine_defined.cpp.
|
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. |
Definition at line 245 of file engine_defined.cpp.
|
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. |
Definition at line 216 of file engine_defined.cpp.
|
overridevirtual |
Generates the Jacobian matrix for the active species.
| Y_dynamic | A vector of abundances for the active species. |
| 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::DynamicEngine.
Definition at line 51 of file engine_defined.cpp.
|
overridevirtual |
Generates the stoichiometry matrix for the active reactions and species.
| std::runtime_error | If the view is stale. |
Implements gridfire::DynamicEngine.
Definition at line 74 of file engine_defined.cpp.
|
overridevirtual |
Access the underlying engine instance.
This method must be implemented by derived classes to provide access to the base engine. The returned reference should remain valid for the lifetime of the EngineView.
Example:
Implements gridfire::EngineView< DynamicEngine >.
Definition at line 22 of file engine_defined.cpp.
|
overridevirtual |
Gets an entry from the Jacobian matrix for the active species.
| i_defined | The row index (species index) in the defined matrix. |
| j_defined | The column index (species index) in the defined matrix. |
| std::runtime_error | If the view is stale. |
| std::out_of_range | If an index is out of bounds. |
Implements gridfire::DynamicEngine.
Definition at line 62 of file engine_defined.cpp.
|
overridevirtual |
Gets the set of active logical reactions in the network.
| std::runtime_error | If the view is stale. |
Implements gridfire::DynamicEngine.
Definition at line 108 of file engine_defined.cpp.
|
overridevirtual |
Gets the list of active species in the network defined by the file.
Implements gridfire::Engine.
Definition at line 26 of file engine_defined.cpp.
|
nodiscardoverridevirtual |
Gets the screening model from the base engine.
Implements gridfire::DynamicEngine.
Definition at line 184 of file engine_defined.cpp.
|
nodiscardoverridevirtual |
Implements gridfire::DynamicEngine.
Definition at line 146 of file engine_defined.cpp.
|
nodiscardoverridevirtual |
Implements gridfire::DynamicEngine.
Definition at line 188 of file engine_defined.cpp.
|
nodiscardoverridevirtual |
Computes timescales for all active species in the network.
| Y_defined | Vector of current abundances for the active species. |
| T9 | Temperature in units of 10^9 K. |
| rho | Density in g/cm^3. |
| std::runtime_error | If the view is stale. |
Implements gridfire::DynamicEngine.
Definition at line 122 of file engine_defined.cpp.
|
overridevirtual |
Gets an entry from the stoichiometry matrix for the active species and reactions.
| speciesIndex_defined | The index of the species in the defined species list. |
| reactionIndex_defined | The index of the reaction in the defined reaction list. |
| std::runtime_error | If the view is stale. |
| std::out_of_range | If an index is out of bounds. |
Implements gridfire::DynamicEngine.
Definition at line 80 of file engine_defined.cpp.
|
overridevirtual |
Implements gridfire::DynamicEngine.
Definition at line 175 of file engine_defined.cpp.
|
private |
Maps a vector of full abundances to a vector of culled abundances.
| full | A vector of abundances for the full network. |
Definition at line 286 of file engine_defined.cpp.
|
nodiscardoverridevirtual |
Implements gridfire::DynamicEngine.
Definition at line 201 of file engine_defined.cpp.
|
private |
Maps a vector of culled abundances to a vector of full abundances.
| defined | A vector of abundances for the active species. |
Definition at line 277 of file engine_defined.cpp.
|
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. |
Definition at line 304 of file engine_defined.cpp.
|
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. |
Definition at line 295 of file engine_defined.cpp.
|
nodiscardoverridevirtual |
Implements gridfire::DynamicEngine.
Definition at line 212 of file engine_defined.cpp.
|
overridevirtual |
Implements gridfire::DynamicEngine.
Definition at line 114 of file engine_defined.cpp.
|
overridevirtual |
Sets the screening model for the base engine.
| model | The screening model to set. |
Implements gridfire::DynamicEngine.
Definition at line 180 of file engine_defined.cpp.
|
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::DynamicEngine.
Definition at line 171 of file engine_defined.cpp.
|
private |
Definition at line 313 of file engine_defined.cpp.
|
private |
Maps indices of active species to indices in the full network.
Definition at line 184 of file engine_defined.h.
|
private |
Active reactions in the defined engine.
Definition at line 182 of file engine_defined.h.
|
protected |
Definition at line 178 of file engine_defined.h.
|
protected |
Definition at line 177 of file engine_defined.h.
|
private |
Active species in the defined engine.
Logger instance for trace and debug information.
Definition at line 180 of file engine_defined.h.
|
private |
Definition at line 189 of file engine_defined.h.
|
private |
Maps indices of active reactions to indices in the full network.
Definition at line 187 of file engine_defined.h.