|
GridFire 0.0.1a
General Purpose Nuclear Network
|
#include <engine_defined.h>
Public Member Functions | |
| FileDefinedEngineView (DynamicEngine &baseEngine, const std::string &fileName, const io::NetworkFileParser &parser) | |
| const 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. | |
| 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 | generateJacobianMatrix (const std::vector< double > &Y_defined, const double T9, const double rho) override |
| Generate the Jacobian matrix for the current state. | |
| double | getJacobianMatrixEntry (const int i_defined, const int j_defined) const override |
| Get an entry from the previously generated Jacobian matrix. | |
| void | generateStoichiometryMatrix () override |
| Generate the stoichiometry matrix for the network. | |
| int | getStoichiometryMatrixEntry (const int speciesIndex_defined, const int reactionIndex_defined) const override |
| Get an entry from the stoichiometry matrix. | |
| 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. | |
| const reaction::LogicalReactionSet & | getNetworkReactions () const override |
| Get the set of logical reactions in the network. | |
| 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. | |
| void | update (const NetIn &netIn) override |
| void | setNetworkFile (const std::string &fileName) |
| void | setScreeningModel (screening::ScreeningType model) override |
| screening::ScreeningType | getScreeningModel () const override |
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. | |
Private Types | |
| using | Config = fourdst::config::Config |
| using | LogManager = fourdst::logging::LogManager |
Private Member Functions | |
| void | buildFromFile (const std::string &fileName) |
| 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 > &culled) 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 culledSpeciesIndex) const |
| Maps a culled species index to a full species index. | |
| size_t | mapViewToFullReactionIndex (size_t culledReactionIndex) const |
| Maps a culled reaction index to a full reaction index. | |
| void | validateNetworkState () const |
Private Attributes | |
| Config & | m_config = Config::getInstance() |
| quill::Logger * | m_logger = LogManager::getInstance().getLogger("log") |
| DynamicEngine & | m_baseEngine |
| std::string | m_fileName |
| Name of the file defining the reaction set considered by the engine view. | |
| const io::NetworkFileParser & | m_parser |
| Parser for the network file. | |
| std::vector< fourdst::atomic::Species > | m_activeSpecies |
| Active species in the defined engine. | |
| reaction::LogicalReactionSet | m_activeReactions |
| Active reactions in the defined engine. | |
| 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. | |
| bool | m_isStale = true |
Definition at line 16 of file engine_defined.h.
|
private |
Definition at line 71 of file engine_defined.h.
|
private |
Definition at line 72 of file engine_defined.h.
|
explicit |
Definition at line 8 of file engine_defined.cpp.
|
private |
Definition at line 208 of file engine_defined.cpp.
|
overridevirtual |
Calculate the molar reaction flow for a given reaction.
| reaction | The reaction for which to calculate the flow. |
| Y | Vector of current abundances. |
| T9 | Temperature in units of 10^9 K. |
| rho | Density in g/cm^3. |
This method computes the net rate at which the given reaction proceeds under the current state.
Implements gridfire::DynamicEngine.
Definition at line 85 of file engine_defined.cpp.
|
overridevirtual |
Calculate the right-hand side (dY/dt) and energy generation.
| Y | Vector of current abundances for all species. |
| T9 | Temperature in units of 10^9 K. |
| rho | Density in g/cm^3. |
This function must be implemented by derived classes to compute the time derivatives of all species and the specific nuclear energy generation rate for the current state.
Implements gridfire::Engine.
Definition at line 29 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.
Definition at line 176 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.
Definition at line 147 of file engine_defined.cpp.
|
overridevirtual |
Generate the Jacobian matrix for the current state.
| Y | Vector of current abundances. |
| T9 | Temperature in units of 10^9 K. |
| rho | Density in g/cm^3. |
This method must compute and store the Jacobian matrix (∂(dY/dt)_i/∂Y_j) for the current state. The matrix can then be accessed via getJacobianMatrixEntry().
Implements gridfire::DynamicEngine.
Definition at line 45 of file engine_defined.cpp.
|
overridevirtual |
Generate the stoichiometry matrix for the network.
This method must compute and store the stoichiometry matrix, which encodes the net change of each species in each reaction.
Implements gridfire::DynamicEngine.
Definition at line 68 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 21 of file engine_defined.cpp.
|
overridevirtual |
Get an entry from the previously generated Jacobian matrix.
| i | Row index (species index). |
| j | Column index (species index). |
The Jacobian must have been generated by generateJacobianMatrix() before calling this.
Implements gridfire::DynamicEngine.
Definition at line 56 of file engine_defined.cpp.
|
overridevirtual |
Get the set of logical reactions in the network.
Implements gridfire::DynamicEngine.
Definition at line 102 of file engine_defined.cpp.
|
overridevirtual |
Get the list of species in the network.
Implements gridfire::Engine.
Definition at line 25 of file engine_defined.cpp.
|
nodiscardoverridevirtual |
Implements gridfire::DynamicEngine.
Definition at line 143 of file engine_defined.cpp.
|
overridevirtual |
Compute timescales for all species in the network.
| Y | Vector of current abundances. |
| T9 | Temperature in units of 10^9 K. |
| rho | Density in g/cm^3. |
This method estimates the timescale for abundance change of each species, which can be used for timestep control, diagnostics, and reaction network culling.
Implements gridfire::DynamicEngine.
Definition at line 108 of file engine_defined.cpp.
|
overridevirtual |
Get an entry from the stoichiometry matrix.
| speciesIndex | Index of the species. |
| reactionIndex | Index of the reaction. |
The stoichiometry matrix must have been generated by generateStoichiometryMatrix().
Implements gridfire::DynamicEngine.
Definition at line 74 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 276 of file engine_defined.cpp.
|
private |
Maps a vector of culled abundances to a vector of full abundances.
| culled | A vector of abundances for the active species. |
Definition at line 267 of file engine_defined.cpp.
|
private |
Maps a culled reaction index to a full reaction index.
| culledReactionIndex | The index of the reaction in the culled reaction list. |
| std::out_of_range | If the culled index is out of bounds for the reaction index map. |
Definition at line 294 of file engine_defined.cpp.
|
private |
Maps a culled species index to a full species index.
| culledSpeciesIndex | The index of the species in the culled species list. |
| std::out_of_range | If the culled index is out of bounds for the species index map. |
Definition at line 285 of file engine_defined.cpp.
| void gridfire::FileDefinedEngineView::setNetworkFile | ( | const std::string & | fileName | ) |
Definition at line 133 of file engine_defined.cpp.
|
overridevirtual |
Implements gridfire::DynamicEngine.
Definition at line 139 of file engine_defined.cpp.
|
overridevirtual |
Implements gridfire::DynamicEngine.
Definition at line 127 of file engine_defined.cpp.
|
private |
Definition at line 303 of file engine_defined.cpp.
|
private |
Active reactions in the defined engine.
Definition at line 81 of file engine_defined.h.
|
private |
Active species in the defined engine.
Definition at line 80 of file engine_defined.h.
|
private |
Definition at line 76 of file engine_defined.h.
|
private |
Definition at line 73 of file engine_defined.h.
|
private |
Name of the file defining the reaction set considered by the engine view.
Definition at line 77 of file engine_defined.h.
|
private |
Definition at line 86 of file engine_defined.h.
|
private |
Definition at line 74 of file engine_defined.h.
|
private |
Parser for the network file.
Definition at line 78 of file engine_defined.h.
|
private |
Maps indices of active reactions to indices in the full network.
Definition at line 84 of file engine_defined.h.
|
private |
Maps indices of active species to indices in the full network.
Definition at line 83 of file engine_defined.h.