|
GridFire v0.7.6rc4.0
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 (scratch::StateBlob &ctx) const override |
| Gets the list of active species in the network defined by the file. | |
| std::expected< StepDerivatives< double >, EngineStatus > | calculateRHSAndEnergy (scratch::StateBlob &ctx, const fourdst::composition::CompositionAbstract &comp, double T9, double rho, bool trust) const override |
| Calculates the right-hand side (dY/dt) and energy generation for the active species. | |
| EnergyDerivatives | calculateEpsDerivatives (scratch::StateBlob &ctx, 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 (scratch::StateBlob &ctx, const fourdst::composition::CompositionAbstract &comp, double T9, double rho) const override |
| Generates the Jacobian matrix for the active species. | |
| NetworkJacobian | generateJacobianMatrix (scratch::StateBlob &ctx, 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 (scratch::StateBlob &ctx, const fourdst::composition::CompositionAbstract &comp, double T9, double rho, const SparsityPattern &sparsityPattern) const override |
| Generates the Jacobian matrix for a given sparsity pattern. | |
| double | calculateMolarReactionFlow (scratch::StateBlob &ctx, 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 (scratch::StateBlob &ctx) const override |
| Gets the set of active logical reactions in the network. | |
| std::expected< std::unordered_map< fourdst::atomic::Species, double >, EngineStatus > | getSpeciesTimescales (scratch::StateBlob &ctx, 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 >, EngineStatus > | getSpeciesDestructionTimescales (scratch::StateBlob &ctx, const fourdst::composition::CompositionAbstract &comp, double T9, double rho) const override |
| Computes destruction timescales for all active species in the network. | |
| fourdst::composition::Composition | project (scratch::StateBlob &ctx, const NetIn &netIn) const override |
| Updates the engine view if it is marked as stale. | |
| screening::ScreeningType | getScreeningModel (scratch::StateBlob &ctx) const override |
| Gets the screening model from the base engine. | |
| size_t | getSpeciesIndex (scratch::StateBlob &ctx, const fourdst::atomic::Species &species) const override |
| Maps a species from the full network to its index in the defined active network. | |
| PrimingReport | primeEngine (scratch::StateBlob &ctx, const NetIn &netIn) const override |
| Prime the engine view for calculations. This will delegate to the base engine. | |
| fourdst::composition::Composition | collectComposition (scratch::StateBlob &ctx, const fourdst::composition::CompositionAbstract &comp, double T9, double rho) const override |
| Collects a Composition object from the base engine. | |
| SpeciesStatus | getSpeciesStatus (scratch::StateBlob &ctx, const fourdst::atomic::Species &species) const override |
| Gets the status of a species in the active network. | |
| std::optional< StepDerivatives< double > > | getMostRecentRHSCalculation (scratch::StateBlob &ctx) const override |
| std::unique_ptr< scratch::StateBlob > | constructStateBlob (const scratch::StateBlob *blob) const override |
Public Member Functions inherited from gridfire::engine::DynamicEngine | |
| virtual reaction::ReactionSet | getInactiveNetworkReactions (scratch::StateBlob &ctx) const |
| Get the set of inactive reactions in the network. | |
| virtual double | getInactiveReactionMolarReactionFlow (scratch::StateBlob &ctx, const reaction::Reaction &reaction, const fourdst::composition::CompositionAbstract &comp, const double T9, const double rho) const |
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 (scratch::StateBlob &ctx) const |
| Constructs the species index map. | |
| std::vector< size_t > | constructReactionIndexMap (scratch::StateBlob &ctx) const |
| Constructs the reaction index map. | |
| std::vector< double > | mapViewToFull (scratch::StateBlob &ctx, const std::vector< double > &defined) const |
| Maps a vector of culled abundances to a vector of full abundances. | |
| size_t | mapViewToFullSpeciesIndex (scratch::StateBlob &ctx, size_t definedSpeciesIndex) const |
| Maps a culled species index to a full species index. | |
| size_t | mapViewToFullReactionIndex (scratch::StateBlob &ctx, size_t definedReactionIndex) const |
| Maps a culled reaction index to a full reaction index. | |
| void | collect (scratch::StateBlob &ctx, const std::vector< std::string > &peNames) const |
Static Private Member Functions | |
| static std::vector< double > | mapFullToView (scratch::StateBlob &ctx, const std::vector< double > &full) |
| Maps a vector of full abundances to a vector of culled abundances. | |
Private Attributes | |
| quill::Logger * | m_logger = LogManager::getInstance().getLogger("log") |
| Logger instance for trace and debug information. | |
| gridfire::engine::DefinedEngineView::DefinedEngineView | ( | const std::vector< std::string > & | peNames, |
| GraphEngine & | baseEngine ) |
|
nodiscardoverridevirtual |
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.
|
nodiscardoverridevirtual |
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.
|
nodiscardoverridevirtual |
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. |
| trust |
| std::runtime_error | If the view is stale (i.e., update() has not been called after setNetworkFile()). |
Implements gridfire::engine::Engine.
|
private |
|
nodiscardoverridevirtual |
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.
|
nodiscardprivate |
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. |
|
nodiscardprivate |
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. |
|
nodiscardoverridevirtual |
Implements gridfire::engine::DynamicEngine.
|
nodiscardoverridevirtual |
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.
|
nodiscardoverridevirtual |
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.
|
nodiscardoverridevirtual |
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.
|
nodiscardoverridevirtual |
Get the base engine associated with this defined engine view.
Implements gridfire::engine::EngineView< DynamicEngine >.
|
nodiscardoverridevirtual |
Implements gridfire::engine::DynamicEngine.
|
nodiscardoverridevirtual |
Gets the set of active logical reactions in the network.
| std::runtime_error | If the view is stale. |
Implements gridfire::engine::DynamicEngine.
|
nodiscardoverridevirtual |
Gets the list of active species in the network defined by the file.
Implements gridfire::engine::Engine.
|
nodiscardoverridevirtual |
Gets the screening model from the base engine.
Implements gridfire::engine::DynamicEngine.
|
nodiscardoverridevirtual |
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.
|
nodiscardoverridevirtual |
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.
|
nodiscardoverridevirtual |
Gets the status of a species in the active network.
| species | The species for which to get the status. |
Implements gridfire::engine::DynamicEngine.
|
nodiscardoverridevirtual |
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.
|
staticnodiscardprivate |
Maps a vector of full abundances to a vector of culled abundances.
| full | A vector of abundances for the full network. |
|
nodiscardprivate |
Maps a vector of culled abundances to a vector of full abundances.
| defined | A vector of abundances for the active species. |
|
nodiscardprivate |
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. |
|
nodiscardprivate |
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. |
|
nodiscardoverridevirtual |
Prime the engine view for calculations. This will delegate to the base engine.
| netIn | The current network input. |
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.
|
protected |
|
protected |
|
private |
Logger instance for trace and debug information.