|
| virtual void | generateJacobianMatrix (const std::vector< double > &Y_dynamic, double T9, double rho) const =0 |
| | Generate the Jacobian matrix for the current state.
|
| |
| virtual void | generateJacobianMatrix (const std::vector< double > &Y_dynamic, double T9, double rho, const SparsityPattern &sparsityPattern) const |
| |
| 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 void | setNetworkReactions (const reaction::LogicalReactionSet &reactions)=0 |
| |
| virtual std::expected< std::unordered_map< fourdst::atomic::Species, double >, expectations::StaleEngineError > | getSpeciesTimescales (const std::vector< double > &Y, double T9, double rho) const =0 |
| | Compute timescales for all species in the network.
|
| |
| virtual std::expected< std::unordered_map< fourdst::atomic::Species, double >, expectations::StaleEngineError > | getSpeciesDestructionTimescales (const std::vector< double > &Y, double T9, double rho) const =0 |
| |
| virtual fourdst::composition::Composition | update (const NetIn &netIn)=0 |
| | Update the internal state of the engine.
|
| |
| virtual bool | isStale (const NetIn &netIn)=0 |
| |
| virtual void | setScreeningModel (screening::ScreeningType model)=0 |
| | Set the electron screening model.
|
| |
| virtual screening::ScreeningType | getScreeningModel () const =0 |
| | Get the current electron screening model.
|
| |
| virtual int | getSpeciesIndex (const fourdst::atomic::Species &species) const =0 |
| |
| virtual std::vector< double > | mapNetInToMolarAbundanceVector (const NetIn &netIn) const =0 |
| |
| virtual PrimingReport | primeEngine (const NetIn &netIn)=0 |
| |
| virtual BuildDepthType | getDepth () const |
| |
| virtual void | rebuild (const fourdst::composition::Composition &comp, BuildDepthType depth) |
| |
| virtual | ~Engine ()=default |
| | Virtual destructor.
|
| |
| virtual const std::vector< fourdst::atomic::Species > & | getNetworkSpecies () const =0 |
| | Get the list of species in the network.
|
| |
| virtual std::expected< StepDerivatives< double >, expectations::StaleEngineError > | 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:
- Generating and accessing the Jacobian matrix (for implicit solvers).
- Generating and accessing the stoichiometry matrix.
- Calculating molar reaction flows for individual reactions.
- Accessing the set of logical reactions in the network.
- Computing timescales for each species.
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.
| virtual std::expected< std::unordered_map< fourdst::atomic::Species, double >, expectations::StaleEngineError > gridfire::DynamicEngine::getSpeciesTimescales |
( |
const std::vector< double > & | Y, |
|
|
double | T9, |
|
|
double | rho ) const |
|
nodiscardpure virtual |
| virtual fourdst::composition::Composition gridfire::DynamicEngine::update |
( |
const NetIn & | netIn | ) |
|
|
pure virtual |
Update the internal state of the engine.
- Parameters
-
| netIn | A struct containing the current network input, such as temperature, density, and composition. |
This method is intended to be implemented by derived classes to update their internal state based on the provided network conditions. For example, an adaptive engine might use this to re-evaluate which reactions and species are active. For other engines that do not support manually updating, this method might do nothing.
- Usage Example:
- Postcondition
- The internal state of the engine is updated to reflect the new conditions.
Implemented in gridfire::AdaptiveEngineView, gridfire::DefinedEngineView, gridfire::GraphEngine, gridfire::MultiscalePartitioningEngineView, and PyDynamicEngine.