GridFire v0.7.6rc4.0
General Purpose Nuclear Network
Loading...
Searching...
No Matches
gridfire::engine::NetworkPrimingEngineView Class Referencefinal

Provides a view of a DynamicEngine filtered to reactions involving a specified priming species. More...

#include <engine_priming.h>

Inheritance diagram for gridfire::engine::NetworkPrimingEngineView:
[legend]
Collaboration diagram for gridfire::engine::NetworkPrimingEngineView:
[legend]

Public Member Functions

 NetworkPrimingEngineView (scratch::StateBlob &ctx, const std::string &primingSymbol, GraphEngine &baseEngine)
 Constructs the view by looking up the priming species by symbol.
 
 NetworkPrimingEngineView (scratch::StateBlob &ctx, const fourdst::atomic::Species &primingSpecies, GraphEngine &baseEngine)
 Constructs the view using an existing Species object.
 
- Public Member Functions inherited from gridfire::engine::DefinedEngineView
 DefinedEngineView (const std::vector< std::string > &peNames, GraphEngine &baseEngine)
 
const DynamicEnginegetBaseEngine () 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 >, EngineStatuscalculateRHSAndEnergy (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::ReactionSetgetNetworkReactions (scratch::StateBlob &ctx) const override
 Gets the set of active logical reactions in the network.
 
std::expected< std::unordered_map< fourdst::atomic::Species, double >, EngineStatusgetSpeciesTimescales (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 >, EngineStatusgetSpeciesDestructionTimescales (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::StateBlobconstructStateBlob (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.
 

Private Member Functions

std::vector< std::string > constructPrimingReactionSet (scratch::StateBlob &ctx, const fourdst::atomic::Species &primingSpecies, const GraphEngine &baseEngine) const
 Constructs the set of reaction names that involve the priming species.
 

Private Attributes

quill::Logger * m_logger = LogManager::getInstance().getLogger("log")
 
fourdst::atomic::Species m_primingSpecies
 The priming species, if specified.
 

Additional Inherited Members

- Protected Attributes inherited from gridfire::engine::DefinedEngineView
bool m_isStale = true
 
GraphEnginem_baseEngine
 

Detailed Description

Provides a view of a DynamicEngine filtered to reactions involving a specified priming species.

This view constructs a subset of the network reactions from the base engine that contain the given priming species and delegates all engine operations to the underlying engine.

See implementation in engine_priming.cpp for details on reaction set construction.

Note
Throws std::runtime_error if no priming reactions are found for the species.

Constructor & Destructor Documentation

◆ NetworkPrimingEngineView() [1/2]

gridfire::engine::NetworkPrimingEngineView::NetworkPrimingEngineView ( scratch::StateBlob & ctx,
const std::string & primingSymbol,
GraphEngine & baseEngine )

Constructs the view by looking up the priming species by symbol.

Parameters
ctxState Blob containing Engine context
primingSymbolSymbol string of the species to prime.
baseEngineReference to the base DynamicEngine to wrap.
Precondition
primingSymbol must correspond to a valid species in atomic::species registry.
Postcondition
The view will contain only reactions that involve the priming species.
Exceptions
std::out_of_rangeIf primingSymbol is not found in the species registry.
std::runtime_errorIf no reactions contain the priming species.

◆ NetworkPrimingEngineView() [2/2]

gridfire::engine::NetworkPrimingEngineView::NetworkPrimingEngineView ( scratch::StateBlob & ctx,
const fourdst::atomic::Species & primingSpecies,
GraphEngine & baseEngine )

Constructs the view using an existing Species object.

Parameters
ctxState Blob containing Engine context
primingSpeciesThe species object to prime.
baseEngineReference to the base DynamicEngine to wrap.
Precondition
primingSpecies must be valid and present in the network of baseEngine.
Postcondition
The view will contain only reactions that involve the priming species.
Exceptions
std::runtime_errorIf no reactions contain the priming species.

Member Function Documentation

◆ constructPrimingReactionSet()

std::vector< std::string > gridfire::engine::NetworkPrimingEngineView::constructPrimingReactionSet ( scratch::StateBlob & ctx,
const fourdst::atomic::Species & primingSpecies,
const GraphEngine & baseEngine ) const
nodiscardprivate

Constructs the set of reaction names that involve the priming species.

Parameters
ctxState blob containing engine context
primingSpeciesSpecies for which to collect priming reactions.
baseEngineBase engine containing the full network of reactions.
Precondition
baseEngine.getNetworkReactions() returns a valid iterable set of reactions.
Postcondition
Returns a vector of unique reaction name strings containing the priming species.
Returns
Vector of reaction name strings containing the priming species.
Exceptions
std::runtime_errorIf no reactions involve the priming species.

Member Data Documentation

◆ m_logger

quill::Logger* gridfire::engine::NetworkPrimingEngineView::m_logger = LogManager::getInstance().getLogger("log")
private

◆ m_primingSpecies

fourdst::atomic::Species gridfire::engine::NetworkPrimingEngineView::m_primingSpecies
private

The priming species, if specified.


The documentation for this class was generated from the following files: