pub struct Lj<T> { /* private fields */ }Expand description
Implementations§
Source§impl<T: Vector> Lj<T>
impl<T: Vector> Lj<T>
Sourcepub fn from_coefficients(c12: f64, c6: f64) -> Self
pub fn from_coefficients(c12: f64, c6: f64) -> Self
Creates a new Lennard-Jones potential from precomputed coefficients.
§Arguments
c12: Coefficient for r^-12 term (4 * epsilon * sigma^12)c6: Coefficient for r^-6 term (4 * epsilon * sigma^6)
This is useful when mixing rules produce c6/c12 directly.
Trait Implementations§
Source§impl<T: Vector> Potential2<T> for Lj<T>
impl<T: Vector> Potential2<T> for Lj<T>
Source§fn force_factor(&self, r_sq: T) -> T
fn force_factor(&self, r_sq: T) -> T
Computes the force factor.
dV/dr = -12*c12/r^13 + 6*c6/r^7
S = -(dV/dr)/r = 12*c12/r^14 - 6*c6/r^8
= 6 * (2*c12/r^12 - c6/r^6) / r^2Source§fn energy_force(&self, r_sq: T) -> (T, T)
fn energy_force(&self, r_sq: T) -> (T, T)
Computes energy and force factor together (optimized).
Shares the computation of r^-6 and r^-12.
impl<T: Copy> Copy for Lj<T>
impl<T> StructuralPartialEq for Lj<T>
Auto Trait Implementations§
impl<T> Freeze for Lj<T>where
T: Freeze,
impl<T> RefUnwindSafe for Lj<T>where
T: RefUnwindSafe,
impl<T> Send for Lj<T>where
T: Send,
impl<T> Sync for Lj<T>where
T: Sync,
impl<T> Unpin for Lj<T>where
T: Unpin,
impl<T> UnwindSafe for Lj<T>where
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