pub struct TimeStepControl { /* private fields */ }Expand description
Time step control
Implementations§
Source§impl TimeStepControl
impl TimeStepControl
pub fn new() -> Self
pub fn initialize(&mut self) -> Result<(), PhysicsError>
Sourcepub fn compute_cfl_dt(&self, max_velocity: f64, dx: f64) -> f64
pub fn compute_cfl_dt(&self, max_velocity: f64, dx: f64) -> f64
Compute the CFL-limited time step: dt = CFL * dx / max_velocity.
The result is clamped to [min_time_step, max_time_step]. If max_velocity
is zero or non-finite, max_time_step is returned (no advective limit).
Sourcepub fn compute_cfl_dt_from_field(&self, dx: f64) -> f64
pub fn compute_cfl_dt_from_field(&self, dx: f64) -> f64
Compute the CFL-limited time step using the velocity field (or sound
speed fallback) stored on the CflCondition.
This is the field-driven overload of compute_cfl_dt: it derives
max_velocity from CflCondition::max_velocity() instead of requiring
it as a parameter. When neither a velocity field nor a sound speed is
set, max_velocity() returns 0.0 and max_time_step is returned.
Sourcepub fn compute_diffusion_dt(&self, diffusion_coeff: f64, dx: f64) -> f64
pub fn compute_diffusion_dt(&self, diffusion_coeff: f64, dx: f64) -> f64
Compute the diffusive CFL-limited time step:
dt_diff = CFL * dx^2 / (2 * diffusion_coeff).
The result is clamped to [min_time_step, max_time_step]. Returns 0.0
for a zero (or non-finite) diffusion coefficient, clamped to the minimum
bound so callers always receive a usable dt.
Auto Trait Implementations§
impl Freeze for TimeStepControl
impl RefUnwindSafe for TimeStepControl
impl Send for TimeStepControl
impl Sync for TimeStepControl
impl Unpin for TimeStepControl
impl UnsafeUnpin for TimeStepControl
impl UnwindSafe for TimeStepControl
Blanket Implementations§
§impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more