pub struct Truncated<P> { /* private fields */ }Expand description
A pair potential cut at r_c: zero for r ≥ r_c, shifted inside by
ShiftMode.
Implementations§
Source§impl<P: PairPotential> Truncated<P>
impl<P: PairPotential> Truncated<P>
Sourcepub fn new(
potential: P,
cutoff: Fix128,
mode: ShiftMode,
) -> Result<Self, PairPotentialError>
pub fn new( potential: P, cutoff: Fix128, mode: ShiftMode, ) -> Result<Self, PairPotentialError>
Cut potential at cutoff > 0 with mode.
§Errors
PairPotentialError::NonPositiveCutoff, or the error of evaluating
the potential at the cutoff.
Trait Implementations§
impl<P: Copy> Copy for Truncated<P>
impl<P: Eq> Eq for Truncated<P>
Source§impl<P: PairPotential> PairPotential for Truncated<P>
impl<P: PairPotential> PairPotential for Truncated<P>
Source§fn energy(&self, r: Fix128) -> Result<Fix128, PairPotentialError>
fn energy(&self, r: Fix128) -> Result<Fix128, PairPotentialError>
Potential energy
U(r) at distance r > 0.Source§fn force(&self, r: Fix128) -> Result<Fix128, PairPotentialError>
fn force(&self, r: Fix128) -> Result<Fix128, PairPotentialError>
Radial force
F(r) = −dU/dr at r > 0 (positive = repulsive).Source§fn force_on_first(&self, d: Vec3Fix) -> Result<Vec3Fix, PairPotentialError>
fn force_on_first(&self, d: Vec3Fix) -> Result<Vec3Fix, PairPotentialError>
Force on the first particle of a pair separated by
d = x_i − x_j:
F(|d|) d / |d|. The second particle receives the negative.impl<P: PartialEq> StructuralPartialEq for Truncated<P>
Auto Trait Implementations§
impl<P> Freeze for Truncated<P>where
P: Freeze,
impl<P> RefUnwindSafe for Truncated<P>where
P: RefUnwindSafe,
impl<P> Send for Truncated<P>where
P: Send,
impl<P> Sync for Truncated<P>where
P: Sync,
impl<P> Unpin for Truncated<P>where
P: Unpin,
impl<P> UnsafeUnpin for Truncated<P>where
P: UnsafeUnpin,
impl<P> UnwindSafe for Truncated<P>where
P: 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> 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