GridFire 0.0.1a General Purpose Nuclear Network

Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | List of all members
gridfire::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::NetworkPrimingEngineView:

## Public Member Functions
| NetworkPrimingEngineView (const std::string &primingSymbol, DynamicEngine &baseEngine)
| Constructs the view by looking up the priming species by symbol.
| NetworkPrimingEngineView (const fourdst::atomic::Species &primingSpecies, DynamicEngine &baseEngine)
| Constructs the view using an existing Species object.
Public Member Functions inherited from gridfire::DefinedEngineView
| DefinedEngineView (const std::vector< std::string > &peNames, DynamicEngine &baseEngine)
const DynamicEngine & | getBaseEngine () const override
| Access the underlying engine instance.
const std::vector< fourdst::atomic::Species > & | getNetworkSpecies () const override
| Gets the list of active species in the network defined by the file.
std::expected< StepDerivatives< double >, expectations::StaleEngineError > | calculateRHSAndEnergy (const std::vector< double > &Y_defined, const double T9, const double rho) const override
| Calculates the right-hand side (dY/dt) and energy generation for the active species.
void | generateJacobianMatrix (const std::vector< double > &Y_dynamic, const double T9, const double rho) const override
| Generates the Jacobian matrix for the active species.
double | getJacobianMatrixEntry (const int i_defined, const int j_defined) const override
| Gets an entry from the Jacobian matrix for the active species.
void | generateStoichiometryMatrix () override
| Generates the stoichiometry matrix for the active reactions and species.
int | getStoichiometryMatrixEntry (const int speciesIndex_defined, const int reactionIndex_defined) const override
| Gets an entry from the stoichiometry matrix for the active species and reactions.
double | calculateMolarReactionFlow (const reaction::Reaction &reaction, const std::vector< double > &Y_defined, const double T9, const double rho) const override
| Calculates the molar reaction flow for a given reaction in the active network.
const reaction::LogicalReactionSet & | getNetworkReactions () const override
| Gets the set of active logical reactions in the network.
void | setNetworkReactions (const reaction::LogicalReactionSet &reactions) override
std::expected< std::unordered_map< fourdst::atomic::Species, double >, expectations::StaleEngineError > | getSpeciesTimescales (const std::vector< double > &Y_defined, const double T9, const double rho) const override
| Computes timescales for all active species in the network.
std::expected< std::unordered_map< fourdst::atomic::Species, double >, expectations::StaleEngineError > | getSpeciesDestructionTimescales (const std::vector< double > &Y_defined, const double T9, const double rho) const override
fourdst::composition::Composition | update (const NetIn &netIn) override
| Updates the engine view if it is marked as stale.
bool | isStale (const NetIn &netIn) override
void | setScreeningModel (screening::ScreeningType model) override
| Sets the screening model for the base engine.
screening::ScreeningType | getScreeningModel () const override
| Gets the screening model from the base engine.
int | getSpeciesIndex (const fourdst::atomic::Species &species) const override
std::vector< double > | mapNetInToMolarAbundanceVector (const NetIn &netIn) const override
PrimingReport | primeEngine (const NetIn &netIn) override
Public Member Functions inherited from gridfire::DynamicEngine
virtual void | generateJacobianMatrix (const std::vector< double > &Y_dynamic, double T9, double rho, const SparsityPattern &sparsityPattern) const
virtual BuildDepthType | getDepth () const
virtual void | rebuild (const fourdst::composition::Composition &comp, BuildDepthType depth)
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 Member Functions
std::vector< std::string > | constructPrimingReactionSet (const fourdst::atomic::Species &primingSpecies, const DynamicEngine &baseEngine) const
| Constructs the set of reaction names that involve the priming species.

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

## Additional Inherited Members
Protected Attributes inherited from gridfire::DefinedEngineView
bool | m_isStale = true
DynamicEngine & | m_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.

Definition at line 30 of file engine_priming.h.

## Constructor & Destructor Documentation

## ◆ NetworkPrimingEngineView() [1/2]

gridfire::NetworkPrimingEngineView::NetworkPrimingEngineView | ( | const std::string & | primingSymbol,
|  | DynamicEngine & | baseEngine )

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

Parameters

  primingSymbol | Symbol string of the species to prime.
  baseEngine | Reference 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_range | If primingSymbol is not found in the species registry.
  std::runtime_error | If no reactions contain the priming species.

Definition at line 23 of file engine_priming.cpp.

## ◆ NetworkPrimingEngineView() [2/2]

gridfire::NetworkPrimingEngineView::NetworkPrimingEngineView | ( | const fourdst::atomic::Species & | primingSpecies,
|  | DynamicEngine & | baseEngine )

Constructs the view using an existing Species object.

Parameters

  primingSpecies | The species object to prime.
  baseEngine | Reference 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_error | If no reactions contain the priming species.

Definition at line 36 of file engine_priming.cpp.

## Member Function Documentation

## ◆ constructPrimingReactionSet()

std::vector< std::string > gridfire::NetworkPrimingEngineView::constructPrimingReactionSet | ( | const fourdst::atomic::Species & | primingSpecies,
|  | const DynamicEngine & | baseEngine ) const
| private

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

Parameters

  primingSpecies | Species for which to collect priming reactions.
  baseEngine | Base 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_error | If no reactions involve the priming species.

Definition at line 51 of file engine_priming.cpp.

## Member Data Documentation

## ◆ m_logger

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

Definition at line 56 of file engine_priming.h.

## ◆ m_primingSpecies

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

The priming species, if specified.

Definition at line 57 of file engine_priming.h.

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

- src/include/gridfire/engine/views/engine_priming.h
- src/lib/engine/views/engine_priming.cpp