GridFire v0.7.6rc4.0
General Purpose Nuclear Network
Loading...
Searching...
No Matches
engine_adaptive_scratchpad.h File Reference

Scratchpad implementation for the AdaptiveEngineView. More...

Include dependency graph for engine_adaptive_scratchpad.h:
This graph shows which files directly or indirectly include this file:

Classes

struct  gridfire::engine::scratch::AdaptiveEngineViewScratchPad
 Scratchpad for storing working memory used by AdaptiveEngineView computations. More...
 

Namespaces

namespace  gridfire
 
namespace  gridfire::engine
 
namespace  gridfire::engine::scratch
 Scratchpad memory management for computational engines.
 

Detailed Description

Scratchpad implementation for the AdaptiveEngineView.

This header defines the AdaptiveEngineViewScratchPad, a concrete implementation of AbstractScratchPad designed for use with the AdaptiveEngineView. It provides thread-local storage for active species and reactions that are dynamically determined during adaptive network computations.

Purpose
The AdaptiveEngineViewScratchPad stores:
  • The set of currently active species in the adaptive network
  • The set of currently active reactions based on network topology
  • Initialization state to track whether the scratchpad is ready for use
Examples
// Create and initialize the scratchpad from an AdaptiveEngineView
AdaptiveEngineView engine = create_adaptive_engine();
scratch.initialize(engine);
if (scratch.is_initialized()) {
// Access active species for computation
for (const auto& species : scratch.active_species) {
// Process each active species
}
}
// Clone for parallel execution
auto worker_scratch = scratch.clone();
Scratchpad implementation for the AdaptiveEngineView.
Scratchpad for storing working memory used by AdaptiveEngineView computations.
Definition engine_adaptive_scratchpad.h:66
bool is_initialized() const override
Check whether the scratchpad has been initialized.
Definition engine_adaptive_scratchpad.h:84
void initialize(const AdaptiveEngineView &engine)
Initialize the scratchpad from an AdaptiveEngineView.
Definition engine_adaptive_scratchpad.h:102
std::vector< fourdst::atomic::Species > active_species
Vector of species currently active in the adaptive network.
Definition engine_adaptive_scratchpad.h:75
std::unique_ptr< AbstractScratchPad > clone() const override
Create a deep copy of this scratchpad.
Definition engine_adaptive_scratchpad.h:127
Thread Safety
This class is not thread-safe. Each thread should have its own instance of AdaptiveEngineViewScratchPad. Use clone() to create independent copies for parallel workers.
See also
AbstractScratchPad
AdaptiveEngineView