GridFire v0.7.6rc4.0 General Purpose Nuclear Network

Loading...
Searching...
No Matches
Classes | Namespaces
engine_adaptive_scratchpad.h File Reference

Scratchpad implementation for the AdaptiveEngineView. More...

`#include "gridfire/engine/scratchpads/scratchpad_abstract.h"`
`#include "gridfire/engine/scratchpads/types.h"`
`#include "gridfire/engine/views/engine_adaptive.h"`
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
  #include "gridfire/engine/scratchpads/engine_adaptive_scratchpad.h"
  #include "gridfire/engine/views/engine_adaptive.h"
  // Create and initialize the scratchpad from an AdaptiveEngineView
  gridfire::engine::scratch::AdaptiveEngineViewScratchPad scratch;
  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();
  engine_adaptive.h
  engine_adaptive_scratchpad.h
  Scratchpad implementation for the AdaptiveEngineView.
  gridfire::engine::scratch::AdaptiveEngineViewScratchPad
  Scratchpad for storing working memory used by AdaptiveEngineView computations.
  Definition engine_adaptive_scratchpad.h:66
  gridfire::engine::scratch::AdaptiveEngineViewScratchPad::is_initialized
  bool is_initialized() const override
  Check whether the scratchpad has been initialized.
  Definition engine_adaptive_scratchpad.h:84
  gridfire::engine::scratch::AdaptiveEngineViewScratchPad::initialize
  void initialize(const AdaptiveEngineView &engine)
  Initialize the scratchpad from an AdaptiveEngineView.
  Definition engine_adaptive_scratchpad.h:102
  gridfire::engine::scratch::AdaptiveEngineViewScratchPad::active_species
  std::vector< fourdst::atomic::Species > active_species
  Vector of species currently active in the adaptive network.
  Definition engine_adaptive_scratchpad.h:75
  gridfire::engine::scratch::AdaptiveEngineViewScratchPad::clone
  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