pub struct EnergyPreservingMethod { /* private fields */ }Expand description
Energy-preserving integrator for Hamiltonian systems
Implementations§
Source§impl EnergyPreservingMethod
impl EnergyPreservingMethod
Sourcepub fn new(
hamiltonian: Box<dyn Fn(&ArrayView1<'_, f64>, &ArrayView1<'_, f64>) -> f64>,
dim: usize,
) -> Self
pub fn new( hamiltonian: Box<dyn Fn(&ArrayView1<'_, f64>, &ArrayView1<'_, f64>) -> f64>, dim: usize, ) -> Self
Create a new energy-preserving integrator
Sourcepub fn discrete_gradient_step(
&self,
q: &ArrayView1<'_, f64>,
p: &ArrayView1<'_, f64>,
dt: f64,
) -> IntegrateResult<(Array1<f64>, Array1<f64>)>
pub fn discrete_gradient_step( &self, q: &ArrayView1<'_, f64>, p: &ArrayView1<'_, f64>, dt: f64, ) -> IntegrateResult<(Array1<f64>, Array1<f64>)>
Discrete gradient method
Sourcepub fn average_vector_field_step(
&self,
q: &ArrayView1<'_, f64>,
p: &ArrayView1<'_, f64>,
dt: f64,
) -> IntegrateResult<(Array1<f64>, Array1<f64>)>
pub fn average_vector_field_step( &self, q: &ArrayView1<'_, f64>, p: &ArrayView1<'_, f64>, dt: f64, ) -> IntegrateResult<(Array1<f64>, Array1<f64>)>
Average vector field method
Auto Trait Implementations§
impl Freeze for EnergyPreservingMethod
impl !RefUnwindSafe for EnergyPreservingMethod
impl !Send for EnergyPreservingMethod
impl !Sync for EnergyPreservingMethod
impl Unpin for EnergyPreservingMethod
impl !UnwindSafe for EnergyPreservingMethod
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