Expand description
Output-grid emission for SolverOptions::t_eval.
When the caller supplies an explicit output grid, the solver must return
(t, y) pairs at exactly those times — not at the natural step grid the
adaptive controller picked. This module provides a small per-step helper
that all solvers wire into their accept branch:
- Before integration starts, build a
TEvalEmitterfrom the requested grid and the integration direction. - After each accepted step, call
TEvalEmitter::emit_stepwith the step endpoints(t_old, y_old, dy_old)and(t_new, y_new, dy_new). Any requested grid points in[t_old, t_new]are flushed to the solver’st_out/y_outbuffers via Hermite cubic interpolation.
The Hermite cubic basis reproduces the endpoints exactly (theta=0 → y_old,
theta=1 → y_new), so requested points that coincide with step boundaries
come back bit-exact. For points strictly inside a step the interpolation
is third-order accurate in h, which is well below the working tolerance
of every solver in this crate at the step sizes the controller picks.
Why Hermite and not each solver’s native dense interpolant? Only DoPri5 and Verner currently expose dedicated dense-output coefficients, while Tsit5 / BDF / Radau5 / ESDIRK don’t. A single Hermite path keeps the contract identical across solvers and makes the wiring auditable in one place. If a higher-order interpolant is needed for a specific solver later, that’s a localised optimisation — not a correctness change.
Structs§
- TEval
Emitter - Per-step emitter that flushes requested-grid points covered by the step.
Functions§
- validate_
grid - Validate that a requested output grid is monotonic in the integration
direction and stays within
[t0, tf].