GridFire v0.7.1_rc2 General Purpose Nuclear Network

Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
gridfire::trigger::solver::CVODE::SimulationTimeTrigger Class Referencefinal

Triggers when the current simulation time advances by at least a fixed interval. More...

`#include <engine_partitioning_trigger.h>`

Inheritance diagram for gridfire::trigger::solver::CVODE::SimulationTimeTrigger:
[legend]
Collaboration diagram for gridfire::trigger::solver::CVODE::SimulationTimeTrigger:
[legend]

## Public Member Functions
| SimulationTimeTrigger (double interval)
| Construct with a positive time interval between firings.
bool | check (const gridfire::solver::CVODESolverStrategy::TimestepContext &ctx) const override
| Evaluate whether enough simulated time has elapsed since the last trigger.
void | update (const gridfire::solver::CVODESolverStrategy::TimestepContext &ctx) override
| Update internal state; if check(ctx) is true, advance last_trigger_time.
void | step (const gridfire::solver::CVODESolverStrategy::TimestepContext &ctx) override
| similar to update but intended to be run on every step not just those where the trigger triggered
void | reset () override
| Reset counters and last trigger bookkeeping (time and delta) to zero.
std::string | name () const override
| Stable human-readable name.
TriggerResult | why (const gridfire::solver::CVODESolverStrategy::TimestepContext &ctx) const override
| Structured explanation of the evaluation outcome.
std::string | describe () const override
| Textual description including configured interval.
size_t | numTriggers () const override
| Number of true evaluations since last reset.
size_t | numMisses () const override
| Number of false evaluations since last reset.
Public Member Functions inherited from gridfire::trigger::Trigger< gridfire::solver::CVODESolverStrategy::TimestepContext >
virtual | ~Trigger ()=default
| Virtual destructor for polymorphic use.

## Private Attributes
quill::Logger * | m_logger = fourdst::logging::LogManager::getInstance().getLogger("log")
| Logger used for trace/error diagnostics.
double | m_interval
| Required time interval between successive triggers.
double | m_last_trigger_time = 0.0
| Time at which the trigger last fired; initialized to 0.
double | m_last_trigger_time_delta = 0.0
| Overshoot relative to interval at the last firing; for diagnostics.
Diagnostics counters
size_t | m_hits = 0
size_t | m_misses = 0
size_t | m_updates = 0
size_t | m_resets = 0

## Detailed Description

Triggers when the current simulation time advances by at least a fixed interval.

- check(ctx) returns true when (ctx.t - last_trigger_time) >= interval.
- update(ctx) will, if check(ctx) is true, record ctx.t as the new last_trigger_time and store a small delta relative to the configured interval (for diagnostics/logging).
- Counters (hits/misses/updates/resets) are maintained for diagnostics; they are mutable to allow updates from const check().

Constraints/Errors:
  - Constructing with a non-positive interval throws std::invalid_argument.

Note
  Thread-safety: not thread-safe; intended for single-threaded trigger evaluation.

See also: engine_partitioning_trigger.cpp for the concrete logic and logging.

## Constructor & Destructor Documentation

## ◆ SimulationTimeTrigger()

gridfire::trigger::solver::CVODE::SimulationTimeTrigger::SimulationTimeTrigger | ( | double | interval | ) |
| explicit

Construct with a positive time interval between firings.

Parameters

  interval | Strictly positive time interval (simulation units) between triggers.

Exceptions

  std::invalid_argument | if interval <= 0.

## Member Function Documentation

## ◆ check()

bool gridfire::trigger::solver::CVODE::SimulationTimeTrigger::check | ( | const gridfire::solver::CVODESolverStrategy::TimestepContext & | ctx | ) | const
| override virtual

Evaluate whether enough simulated time has elapsed since the last trigger.

Parameters

  ctx | CVODE timestep context providing the current simulation time (ctx.t).

Returns
  true if (ctx.t - last_trigger_time) >= interval; false otherwise.

Postcondition
  increments hit/miss counters and may emit trace logs.

Implements gridfire::trigger::Trigger< gridfire::solver::CVODESolverStrategy::TimestepContext >.

## ◆ describe()

std::string gridfire::trigger::solver::CVODE::SimulationTimeTrigger::describe | ( |  | ) | const
| override virtual

Textual description including configured interval.

Implements gridfire::trigger::Trigger< gridfire::solver::CVODESolverStrategy::TimestepContext >.

## ◆ name()

std::string gridfire::trigger::solver::CVODE::SimulationTimeTrigger::name | ( |  | ) | const
| override virtual

Stable human-readable name.

Implements gridfire::trigger::Trigger< gridfire::solver::CVODESolverStrategy::TimestepContext >.

## ◆ numMisses()

size_t gridfire::trigger::solver::CVODE::SimulationTimeTrigger::numMisses | ( |  | ) | const
| override virtual

Number of false evaluations since last reset.

Implements gridfire::trigger::Trigger< gridfire::solver::CVODESolverStrategy::TimestepContext >.

## ◆ numTriggers()

size_t gridfire::trigger::solver::CVODE::SimulationTimeTrigger::numTriggers | ( |  | ) | const
| override virtual

Number of true evaluations since last reset.

Implements gridfire::trigger::Trigger< gridfire::solver::CVODESolverStrategy::TimestepContext >.

## ◆ reset()

void gridfire::trigger::solver::CVODE::SimulationTimeTrigger::reset | ( |  | ) |
| override virtual

Reset counters and last trigger bookkeeping (time and delta) to zero.

Implements gridfire::trigger::Trigger< gridfire::solver::CVODESolverStrategy::TimestepContext >.

## ◆ step()

void gridfire::trigger::solver::CVODE::SimulationTimeTrigger::step | ( | const gridfire::solver::CVODESolverStrategy::TimestepContext & | ctx | ) |
| override virtual

similar to update but intended to be run on every step not just those where the trigger triggered

Parameters

  ctx | Context snapshot used to update state.

Implements gridfire::trigger::Trigger< gridfire::solver::CVODESolverStrategy::TimestepContext >.

## ◆ update()

void gridfire::trigger::solver::CVODE::SimulationTimeTrigger::update | ( | const gridfire::solver::CVODESolverStrategy::TimestepContext & | ctx | ) |
| override virtual

Update internal state; if check(ctx) is true, advance last_trigger_time.

Parameters

  ctx | CVODE timestep context.

Note
  update() calls check(ctx) and, on success, records the overshoot delta (ctx.t - last_trigger_time) - interval for diagnostics.

Implements gridfire::trigger::Trigger< gridfire::solver::CVODESolverStrategy::TimestepContext >.

## ◆ why()

TriggerResult gridfire::trigger::solver::CVODE::SimulationTimeTrigger::why | ( | const gridfire::solver::CVODESolverStrategy::TimestepContext & | ctx | ) | const
| override virtual

Structured explanation of the evaluation outcome.

Parameters

  ctx | CVODE timestep context.

Returns
  TriggerResult including name, value, and description.

Implements gridfire::trigger::Trigger< gridfire::solver::CVODESolverStrategy::TimestepContext >.

## Member Data Documentation

## ◆ m_hits

size_t gridfire::trigger::solver::CVODE::SimulationTimeTrigger::m_hits = 0
| mutable private

## ◆ m_interval

double gridfire::trigger::solver::CVODE::SimulationTimeTrigger::m_interval
| private

Required time interval between successive triggers.

## ◆ m_last_trigger_time

double gridfire::trigger::solver::CVODE::SimulationTimeTrigger::m_last_trigger_time = 0.0
| mutable private

Time at which the trigger last fired; initialized to 0.

## ◆ m_last_trigger_time_delta

double gridfire::trigger::solver::CVODE::SimulationTimeTrigger::m_last_trigger_time_delta = 0.0
| mutable private

Overshoot relative to interval at the last firing; for diagnostics.

## ◆ m_logger

quill::Logger* gridfire::trigger::solver::CVODE::SimulationTimeTrigger::m_logger = fourdst::logging::LogManager::getInstance().getLogger("log")
| private

Logger used for trace/error diagnostics.

## ◆ m_misses

size_t gridfire::trigger::solver::CVODE::SimulationTimeTrigger::m_misses = 0
| mutable private

## ◆ m_resets

size_t gridfire::trigger::solver::CVODE::SimulationTimeTrigger::m_resets = 0
| mutable private

## ◆ m_updates

size_t gridfire::trigger::solver::CVODE::SimulationTimeTrigger::m_updates = 0
| mutable private

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

- src/include/gridfire/solver/strategies/triggers/engine_partitioning_trigger.h
- src/lib/solver/strategies/triggers/engine_partitioning_trigger.cpp