pub struct Yukawa { /* private fields */ }Expand description
Screened Coulomb (Yukawa / Debye–Hückel) interaction
U = k q_i q_j e^{−r/λ} / r.
Implementations§
Source§impl Yukawa
impl Yukawa
Sourcepub fn new(
charge_i: Fix128,
charge_j: Fix128,
screening_length: Fix128,
) -> Result<Self, PairPotentialError>
pub fn new( charge_i: Fix128, charge_j: Fix128, screening_length: Fix128, ) -> Result<Self, PairPotentialError>
Charges in coulombs with COULOMB_CONSTANT and screening length
λ > 0.
§Errors
Sourcepub fn with_constant(
coulomb_constant: Fix128,
charge_i: Fix128,
charge_j: Fix128,
screening_length: Fix128,
) -> Result<Self, PairPotentialError>
pub fn with_constant( coulomb_constant: Fix128, charge_i: Fix128, charge_j: Fix128, screening_length: Fix128, ) -> Result<Self, PairPotentialError>
Charges with an explicit constant k > 0 and screening length λ > 0.
§Errors
PairPotentialError::NonPositiveCoulombConstant,
PairPotentialError::NonPositiveScreeningLength.
Trait Implementations§
impl Copy for Yukawa
impl Eq for Yukawa
Source§impl PairPotential for Yukawa
impl PairPotential for Yukawa
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 StructuralPartialEq for Yukawa
Auto Trait Implementations§
impl Freeze for Yukawa
impl RefUnwindSafe for Yukawa
impl Send for Yukawa
impl Sync for Yukawa
impl Unpin for Yukawa
impl UnsafeUnpin for Yukawa
impl UnwindSafe for Yukawa
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