pub struct Switch<P, T> { /* private fields */ }Expand description
Implementations§
Source§impl<P, T: Vector> Switch<P, T>
impl<P, T: Vector> Switch<P, T>
Sourcepub fn new(inner: P, rs: f64, rc: f64) -> Self
pub fn new(inner: P, rs: f64, rc: f64) -> Self
Creates a new switching function wrapper.
§Arguments
inner: The potential to wraprs: Switch-on distance (where switching starts) (length)rc: Cutoff distance (where potential is zero) (length)
§Panics
In debug mode, panics if rs >= rc.
§Example
use potentials::{pair::Lj, meta::Switch};
let lj = Lj::<f64>::new(1.0, 3.4);
let lj_switch: Switch<_, f64> = Switch::new(lj, 9.0, 12.0);Trait Implementations§
Source§impl<P: Potential2<T>, T: Vector> Potential2<T> for Switch<P, T>
impl<P: Potential2<T>, T: Vector> Potential2<T> for Switch<P, T>
impl<P: Copy, T: Copy> Copy for Switch<P, T>
Auto Trait Implementations§
impl<P, T> Freeze for Switch<P, T>
impl<P, T> RefUnwindSafe for Switch<P, T>where
P: RefUnwindSafe,
T: RefUnwindSafe,
impl<P, T> Send for Switch<P, T>
impl<P, T> Sync for Switch<P, T>
impl<P, T> Unpin for Switch<P, T>
impl<P, T> UnwindSafe for Switch<P, T>where
P: UnwindSafe,
T: 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