pub struct Coulomb { /* private fields */ }Expand description
Coulomb interaction U = k q_i q_j / r of two point charges.
Implementations§
Source§impl Coulomb
impl Coulomb
Sourcepub fn new(charge_i: Fix128, charge_j: Fix128) -> Self
pub fn new(charge_i: Fix128, charge_j: Fix128) -> Self
Charges q_i, q_j in coulombs with COULOMB_CONSTANT.
Sourcepub fn with_constant(
coulomb_constant: Fix128,
charge_i: Fix128,
charge_j: Fix128,
) -> Result<Self, PairPotentialError>
pub fn with_constant( coulomb_constant: Fix128, charge_i: Fix128, charge_j: Fix128, ) -> Result<Self, PairPotentialError>
Charges with an explicit constant k > 0 (e.g. k = 1 in reduced
units).
§Errors
Trait Implementations§
impl Copy for Coulomb
impl Eq for Coulomb
Source§impl PairPotential for Coulomb
impl PairPotential for Coulomb
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 Coulomb
Auto Trait Implementations§
impl Freeze for Coulomb
impl RefUnwindSafe for Coulomb
impl Send for Coulomb
impl Sync for Coulomb
impl Unpin for Coulomb
impl UnsafeUnpin for Coulomb
impl UnwindSafe for Coulomb
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