GridFire v0.7.6rc4.0
General Purpose Nuclear Network
Loading...
Searching...
No Matches
gridfire::engine::scratch::AdaptiveEngineViewScratchPad Struct Referencefinal

Scratchpad for storing working memory used by AdaptiveEngineView computations. More...

#include <engine_adaptive_scratchpad.h>

Inheritance diagram for gridfire::engine::scratch::AdaptiveEngineViewScratchPad:
[legend]
Collaboration diagram for gridfire::engine::scratch::AdaptiveEngineViewScratchPad:
[legend]

Public Member Functions

bool is_initialized () const override
 Check whether the scratchpad has been initialized.
 
void initialize (const AdaptiveEngineView &engine)
 Initialize the scratchpad from an AdaptiveEngineView.
 
std::unique_ptr< AbstractScratchPadclone () const override
 Create a deep copy of this scratchpad.
 
- Public Member Functions inherited from gridfire::engine::scratch::AbstractScratchPad
virtual ~AbstractScratchPad ()=default
 Virtual destructor for proper cleanup of derived classes.
 

Public Attributes

bool has_initialized = false
 Flag indicating whether the scratchpad has been initialized.
 
std::vector< fourdst::atomic::Species > active_species
 Vector of species currently active in the adaptive network.
 
reaction::ReactionSet active_reactions
 Set of reactions currently active in the adaptive network.
 

Static Public Attributes

static constexpr auto ID = ScratchPadType::ADAPTIVE_ENGINE_VIEW_SCRATCHPAD
 Unique identifier for this scratchpad type.
 

Detailed Description

Scratchpad for storing working memory used by AdaptiveEngineView computations.

AdaptiveEngineViewScratchPad provides temporary storage for the active species and reactions determined by the adaptive network algorithm. This allows the engine to avoid recalculating network topology on every evaluation.

Thread Safety
This class is not thread-safe. Each thread should operate on its own independent instance. Use clone() to create copies for parallel execution.

Member Function Documentation

◆ clone()

std::unique_ptr< AbstractScratchPad > gridfire::engine::scratch::AdaptiveEngineViewScratchPad::clone ( ) const
inlineoverridevirtual

Create a deep copy of this scratchpad.

Creates an independent copy of all internal state, including active species and reactions. The clone can be modified without affecting the original.

Returns
A unique pointer to the cloned scratchpad.
Examples
auto original = std::make_unique<AdaptiveEngineViewScratchPad>();
original->initialize(engine);
// Create independent copy for a worker thread
auto worker_copy = original->clone();
Definition dynamic_engine_diagnostics.h:39

Implements gridfire::engine::scratch::AbstractScratchPad.

◆ initialize()

void gridfire::engine::scratch::AdaptiveEngineViewScratchPad::initialize ( const AdaptiveEngineView & engine)
inline

Initialize the scratchpad from an AdaptiveEngineView.

Clears any existing state and prepares the scratchpad for use. This method is idempotent; calling it multiple times has no effect after the first successful initialization.

Parameters
engineThe AdaptiveEngineView to initialize from.
Examples
AdaptiveEngineView engine = create_engine();
scratch.initialize(engine);
An engine view that dynamically adapts the reaction network based on runtime conditions.
Definition engine_adaptive.h:50
Scratchpad memory management for computational engines.
Definition blob.h:69
Scratchpad for storing working memory used by AdaptiveEngineView computations.
Definition engine_adaptive_scratchpad.h:66

◆ is_initialized()

bool gridfire::engine::scratch::AdaptiveEngineViewScratchPad::is_initialized ( ) const
inlinenodiscardoverridevirtual

Check whether the scratchpad has been initialized.

Returns
true if initialized, false otherwise.

Implements gridfire::engine::scratch::AbstractScratchPad.

Member Data Documentation

◆ active_reactions

reaction::ReactionSet gridfire::engine::scratch::AdaptiveEngineViewScratchPad::active_reactions

Set of reactions currently active in the adaptive network.

◆ active_species

std::vector<fourdst::atomic::Species> gridfire::engine::scratch::AdaptiveEngineViewScratchPad::active_species

Vector of species currently active in the adaptive network.

◆ has_initialized

bool gridfire::engine::scratch::AdaptiveEngineViewScratchPad::has_initialized = false

Flag indicating whether the scratchpad has been initialized.

◆ ID

auto gridfire::engine::scratch::AdaptiveEngineViewScratchPad::ID = ScratchPadType::ADAPTIVE_ENGINE_VIEW_SCRATCHPAD
staticconstexpr

Unique identifier for this scratchpad type.


The documentation for this struct was generated from the following file: