pub struct Harm<T> { /* private fields */ }Expand description
Implementations§
Source§impl<T: Vector> Harm<T>
impl<T: Vector> Harm<T>
Sourcepub fn new(k: f64, xi0: f64) -> Self
pub fn new(k: f64, xi0: f64) -> Self
Creates a new harmonic improper potential.
§Arguments
k: Force constant (energy/radian² units)xi0: Equilibrium angle (radians)
§Example
use potentials::imp::Harm;
// Planar constraint for aromatic ring
let planar = Harm::<f64>::planar(40.0);
// Chiral center constraint
let chiral = Harm::<f64>::tetrahedral(40.0);Sourcepub fn tetrahedral(k: f64) -> Self
pub fn tetrahedral(k: f64) -> Self
Creates for tetrahedral geometry (xi0 = 35.26°).
The tetrahedral angle from the base is arcsin(1/sqrt(3)) ≈ 35.26°
Trait Implementations§
Source§impl<T: Vector> Potential4<T> for Harm<T>
impl<T: Vector> Potential4<T> for Harm<T>
Source§fn energy(&self, cos_xi: T, sin_xi: T) -> T
fn energy(&self, cos_xi: T, sin_xi: T) -> T
Computes the potential energy.
V = k * (xi - xi0)^2Source§fn derivative(&self, cos_xi: T, sin_xi: T) -> T
fn derivative(&self, cos_xi: T, sin_xi: T) -> T
Computes dV/d(xi).
dV/d(xi) = 2k * (xi - xi0)Source§fn energy_derivative(&self, cos_xi: T, sin_xi: T) -> (T, T)
fn energy_derivative(&self, cos_xi: T, sin_xi: T) -> (T, T)
Computes energy and derivative together (optimized).
Shares the computation of sin_delta, cos_delta, and delta_xi.
impl<T: Copy> Copy for Harm<T>
impl<T> StructuralPartialEq for Harm<T>
Auto Trait Implementations§
impl<T> Freeze for Harm<T>where
T: Freeze,
impl<T> RefUnwindSafe for Harm<T>where
T: RefUnwindSafe,
impl<T> Send for Harm<T>where
T: Send,
impl<T> Sync for Harm<T>where
T: Sync,
impl<T> Unpin for Harm<T>where
T: Unpin,
impl<T> UnwindSafe for Harm<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