pub struct MomentumPreservingMethod { /* private fields */ }Expand description
Momentum-preserving integrator
Implementations§
Source§impl MomentumPreservingMethod
impl MomentumPreservingMethod
Sourcepub fn new(
dim: usize,
force: Box<dyn Fn(&ArrayView1<'_, f64>) -> Array1<f64>>,
mass: Array1<f64>,
) -> Self
pub fn new( dim: usize, force: Box<dyn Fn(&ArrayView1<'_, f64>) -> Array1<f64>>, mass: Array1<f64>, ) -> Self
Create a new momentum-preserving integrator
Sourcepub fn step(
&self,
x: &ArrayView1<'_, f64>,
v: &ArrayView1<'_, f64>,
dt: f64,
) -> IntegrateResult<(Array1<f64>, Array1<f64>)>
pub fn step( &self, x: &ArrayView1<'_, f64>, v: &ArrayView1<'_, f64>, dt: f64, ) -> IntegrateResult<(Array1<f64>, Array1<f64>)>
Integrate one step preserving total momentum
Auto Trait Implementations§
impl Freeze for MomentumPreservingMethod
impl !RefUnwindSafe for MomentumPreservingMethod
impl !Send for MomentumPreservingMethod
impl !Sync for MomentumPreservingMethod
impl Unpin for MomentumPreservingMethod
impl !UnwindSafe for MomentumPreservingMethod
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> 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