pub struct FixedStepsize<F> { /* private fields */ }Expand description
Time stepping with a fixed time length
This time-stepper increments the time variable by the same length.
let t0 = 1.0;
let dt = 0.2;
let partial_save_points = vec![3.0, 5.0, 11.0, 20.0];
let time_stepper = FixedStepsize::from_partial_save_points(t0, dt, partial_save_points).unwrap();Implementations§
Source§impl<F> FixedStepsize<F>
impl<F> FixedStepsize<F>
Sourcepub fn from_partial_save_steps(
t0: F,
dt: F,
n_steps: u64,
save_interval: u64,
) -> Result<Self, TimeError>
pub fn from_partial_save_steps( t0: F, dt: F, n_steps: u64, save_interval: u64, ) -> Result<Self, TimeError>
Construct the stepper from initial time, increment, number of steps and save interval
Sourcepub fn from_partial_save_interval(
t0: F,
dt: F,
t_max: F,
save_interval: F,
) -> Result<Self, TimeError>
pub fn from_partial_save_interval( t0: F, dt: F, t_max: F, save_interval: F, ) -> Result<Self, TimeError>
Similar to Self::from_partial_save_points but specify the time step between every save point together with the integration step.
Sourcepub fn from_partial_save_freq(
t0: F,
dt: F,
t_max: F,
save_freq: usize,
) -> Result<Self, TimeError>
pub fn from_partial_save_freq( t0: F, dt: F, t_max: F, save_freq: usize, ) -> Result<Self, TimeError>
Similar to Self::from_partial_save_interval but specify a multiple of the time increment instead of a floating point value. This method is preferred over the one previously mentioned.
Sourcepub fn from_partial_save_points(
t0: F,
dt: F,
partial_save_points: Vec<F>,
) -> Result<Self, TimeError>
pub fn from_partial_save_points( t0: F, dt: F, partial_save_points: Vec<F>, ) -> Result<Self, TimeError>
Simple function to construct the stepper from an initial time point, the time increment and the time points at which the simulation should be saved. Notice that these saves do not cover FullSaves but only PartialSaves.
Trait Implementations§
Source§impl<F: Clone> Clone for FixedStepsize<F>
impl<F: Clone> Clone for FixedStepsize<F>
Source§fn clone(&self) -> FixedStepsize<F>
fn clone(&self) -> FixedStepsize<F>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'de, F> Deserialize<'de> for FixedStepsize<F>where
F: Deserialize<'de>,
impl<'de, F> Deserialize<'de> for FixedStepsize<F>where
F: Deserialize<'de>,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<F> Serialize for FixedStepsize<F>where
F: Serialize,
impl<F> Serialize for FixedStepsize<F>where
F: Serialize,
Source§impl<F> TimeStepper<F> for FixedStepsize<F>where
F: Float + FromPrimitive,
impl<F> TimeStepper<F> for FixedStepsize<F>where
F: Float + FromPrimitive,
Source§fn advance(&mut self) -> Result<Option<NextTimePoint<F>>, TimeError>
fn advance(&mut self) -> Result<Option<NextTimePoint<F>>, TimeError>
Advances the time stepper to the next time point. Also returns if there is an event
scheduled to take place and the next time value and iteration number
Source§fn save_initial(&self) -> Option<NextTimePoint<F>>
fn save_initial(&self) -> Option<NextTimePoint<F>>
Indicates if the initial values should be stored
Source§fn get_last_full_save(&self) -> Option<(F, usize)>
fn get_last_full_save(&self) -> Option<(F, usize)>
Retrieved the last point at which the simulation was fully recovered.
This might be helpful in the future when error handling is more mature and able to recover.
Auto Trait Implementations§
impl<F> Freeze for FixedStepsize<F>where
F: Freeze,
impl<F> RefUnwindSafe for FixedStepsize<F>where
F: RefUnwindSafe,
impl<F> Send for FixedStepsize<F>where
F: Send,
impl<F> Sync for FixedStepsize<F>where
F: Sync,
impl<F> Unpin for FixedStepsize<F>where
F: Unpin,
impl<F> UnwindSafe for FixedStepsize<F>where
F: UnwindSafe,
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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>
Converts
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>
Converts
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