pub struct UnifiedTimeStepper {
pub domains: Vec<TimeDomainState>,
pub global_dt: f64,
pub global_time: f64,
pub subcycle_ratios: Vec<usize>,
}Expand description
Coordinates adaptive time-stepping across multiple physics domains.
Each domain may have a different natural timestep; the stepper computes a
global step size (the minimum, after safety factors) and determines how
many sub-steps faster domains effectively need within that global window.
Domains whose natural timestep is larger than the global one take a single
step of size global_dt.
Fields§
§domains: Vec<TimeDomainState>Per-domain states.
global_dt: f64Current global timestep (minimum across domains, with safety).
global_time: f64Accumulated simulation time.
subcycle_ratios: Vec<usize>How many sub-steps each domain takes per global step.
Implementations§
Source§impl UnifiedTimeStepper
impl UnifiedTimeStepper
Sourcepub fn new(configs: Vec<TimeDomainConfig>) -> Self
pub fn new(configs: Vec<TimeDomainConfig>) -> Self
Create a new stepper from per-domain configurations.
Sourcepub fn compute_global_dt(&mut self) -> f64
pub fn compute_global_dt(&mut self) -> f64
Compute and update the global timestep (minimum across domains).
Returns the new global_dt.
Sourcepub fn compute_subcycle_ratios(&mut self)
pub fn compute_subcycle_ratios(&mut self)
Recompute the subcycle ratios based on the current global_dt and
each domain’s current_dt.
Sourcepub fn advance_global_time(&mut self)
pub fn advance_global_time(&mut self)
Advance the global simulation time by one global_dt and increment
each domain’s step counter by its subcycle ratio.
Sourcepub fn update_domain_dt(&mut self, domain_idx: usize, new_dt: f64) -> bool
pub fn update_domain_dt(&mut self, domain_idx: usize, new_dt: f64) -> bool
Update a domain’s suggested timestep.
The new value is clamped to the domain’s [min_dt, max_dt] range.
Returns true if domain_idx was valid, false otherwise.
Sourcepub fn update_domain_error(&mut self, domain_idx: usize, error: f64) -> bool
pub fn update_domain_error(&mut self, domain_idx: usize, error: f64) -> bool
Record an error estimate for a domain (used by Richardson / embedded-pair integrators).
Returns true if domain_idx was valid, false otherwise.
Sourcepub fn step_schedule(&self) -> Vec<StepSchedule>
pub fn step_schedule(&self) -> Vec<StepSchedule>
Generate the step schedule describing how each domain should be advanced during the next global step.
Trait Implementations§
Source§impl Clone for UnifiedTimeStepper
impl Clone for UnifiedTimeStepper
Source§fn clone(&self) -> UnifiedTimeStepper
fn clone(&self) -> UnifiedTimeStepper
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for UnifiedTimeStepper
impl RefUnwindSafe for UnifiedTimeStepper
impl Send for UnifiedTimeStepper
impl Sync for UnifiedTimeStepper
impl Unpin for UnifiedTimeStepper
impl UnsafeUnpin for UnifiedTimeStepper
impl UnwindSafe for UnifiedTimeStepper
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.