pub struct SimulationTime { /* private fields */ }Expand description
The temporal coordinate associated with one SystemState.
iteration is always present and provides deterministic ordering, chunk
boundaries, and checkpoint identity. physical_time optionally records a
finite domain time such as seconds or model time. Time-axis units belong to
stream metadata so they are not repeated in every state.
Implementations§
Source§impl SimulationTime
impl SimulationTime
Sourcepub const fn from_iteration(iteration: u64) -> Self
pub const fn from_iteration(iteration: u64) -> Self
Creates an iteration-only time point.
Sourcepub fn from_iteration_and_physical_time(
iteration: u64,
physical_time: f64,
) -> Option<Self>
pub fn from_iteration_and_physical_time( iteration: u64, physical_time: f64, ) -> Option<Self>
Creates a time point with a finite physical coordinate.
Returns None for NaN or either infinity. Negative finite values are
accepted because some scientific coordinate systems use an origin after
the beginning of a simulation or observation.
Sourcepub const fn physical_time(self) -> Option<f64>
pub const fn physical_time(self) -> Option<f64>
Returns the optional physical coordinate.
Sourcepub fn checked_advance(
self,
physical_time_increment: Option<f64>,
) -> Result<Self, StateError>
pub fn checked_advance( self, physical_time_increment: Option<f64>, ) -> Result<Self, StateError>
Computes the next scientific time without mutating a state.
None advances only the iteration and preserves the optional physical
coordinate. Some(delta) also advances an existing physical coordinate.
All overflow and finiteness checks are identical to
SystemState::advance_simulation_time.
Trait Implementations§
Source§impl Clone for SimulationTime
impl Clone for SimulationTime
Source§fn clone(&self) -> SimulationTime
fn clone(&self) -> SimulationTime
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more