|
GridFire 0.0.1a
General Purpose Nuclear Network
|
Abstract class for engines supporting Jacobian and stoichiometry operations. More...
#include <engine_abstract.h>
Public Member Functions | |
| virtual void | generateJacobianMatrix (const std::vector< double > &Y, double T9, double rho)=0 |
| Generate the Jacobian matrix for the current state. | |
| virtual double | getJacobianMatrixEntry (int i, int j) const =0 |
| Get an entry from the previously generated Jacobian matrix. | |
| virtual void | generateStoichiometryMatrix ()=0 |
| Generate the stoichiometry matrix for the network. | |
| virtual int | getStoichiometryMatrixEntry (int speciesIndex, int reactionIndex) const =0 |
| Get an entry from the stoichiometry matrix. | |
| virtual double | calculateMolarReactionFlow (const reaction::Reaction &reaction, const std::vector< double > &Y, double T9, double rho) const =0 |
| Calculate the molar reaction flow for a given reaction. | |
| virtual const reaction::LogicalReactionSet & | getNetworkReactions () const =0 |
| Get the set of logical reactions in the network. | |
| virtual std::unordered_map< fourdst::atomic::Species, double > | getSpeciesTimescales (const std::vector< double > &Y, double T9, double rho) const =0 |
| Compute timescales for all species in the network. | |
Public Member Functions inherited from gridfire::Engine | |
| virtual | ~Engine ()=default |
| Virtual destructor. | |
| virtual const std::vector< fourdst::atomic::Species > & | getNetworkSpecies () const =0 |
| Get the list of species in the network. | |
| virtual StepDerivatives< double > | calculateRHSAndEnergy (const std::vector< double > &Y, double T9, double rho) const =0 |
| Calculate the right-hand side (dY/dt) and energy generation. | |
Abstract class for engines supporting Jacobian and stoichiometry operations.
Extends Engine with additional methods for:
Intended usage: Derive from this class to implement engines that support advanced solver features such as implicit integration, sensitivity analysis, QSE (Quasi-Steady-State Equilibrium) handling, and more.
Definition at line 118 of file engine_abstract.h.
|
pure virtual |
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.
Implemented in gridfire::AdaptiveEngineView, and gridfire::GraphEngine.
|
pure virtual |
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().
Implemented in gridfire::AdaptiveEngineView, and gridfire::GraphEngine.
|
pure virtual |
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.
Implemented in gridfire::AdaptiveEngineView, and gridfire::GraphEngine.
|
pure virtual |
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.
Implemented in gridfire::AdaptiveEngineView, and gridfire::GraphEngine.
|
pure virtual |
Get the set of logical reactions in the network.
Implemented in gridfire::AdaptiveEngineView, and gridfire::GraphEngine.
|
pure virtual |
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.
Implemented in gridfire::AdaptiveEngineView, and gridfire::GraphEngine.
|
pure virtual |
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().
Implemented in gridfire::AdaptiveEngineView, and gridfire::GraphEngine.