DxdtMax

class cubie.outputhandling.summarymetrics.dxdt_max.DxdtMax(precision)[source]

Bases: SummaryMetric

Summary metric that tracks maximum first derivative values.

Notes

Uses two buffer slots: buffer[0] for previous value and buffer[1] for maximum unscaled derivative. The derivative is computed using finite differences and scaled by sample_summaries_every in the save function.

__init__(precision) None[source]

Initialise the DxdtMax summary metric.

build() MetricFuncCache[source]

Generate CUDA device functions for maximum derivative calculation.

Returns:

Cache containing the device update and save callbacks.

Return type:

MetricFuncCache

Notes

The update callback computes finite differences and tracks the maximum unscaled derivative. The save callback scales by sample_summaries_every and resets the buffers.