HydrogenBond

Struct HydrogenBond 

Source
pub struct HydrogenBond<const N: usize>;
Expand description

DREIDING Hydrogen Bond potential (12-10).

§Physics

Models the explicit hydrogen bonding interaction (typically D-H…A) using a specific 12-10 Radial potential modulated by a $\cos^N\theta$ Angular term. Standard DREIDING uses $N=4$.

  • Formula: $$ E = D_{hb} \left[ 5 \left(\frac{R_{hb}}{r}\right)^{12} - 6 \left(\frac{R_{hb}}{r}\right)^{10} \right] \cos^N \theta $$
  • Derivative Factor (Radial): $$ D_{rad} = - \frac{1}{r} \frac{\partial E}{\partial r} = \frac{60 D_{hb}}{r^2} \left[ \left(\frac{R_{hb}}{r}\right)^{12} - \left(\frac{R_{hb}}{r}\right)^{10} \right] \cos^N \theta $$
  • Derivative Factor (Angular): $$ D_{ang} = \frac{\partial E}{\partial (\cos\theta)} = N \cdot E_{rad} \cos^{N-1} \theta $$

§Parameters

  • d_hb: The energy well depth $D_{hb}$.
  • r_hb_sq: The squared equilibrium distance $R_{hb}^2$.
  • N: The cosine power exponent (const generic).

§Inputs

  • r_sq: Squared distance $r^2$ between Donor (D) and Acceptor (A).
  • cos_theta: Cosine of the angle $\theta_{DHA}$ (at Hydrogen).

§Implementation Notes

  • Cutoff: If $\cos\theta \le 0$, energy and forces represent 0.
  • Optimization: Uses $s = (R_{hb}/r)^2$ recurrence to compute $r^{-10}$ and $r^{-12}$ efficiently.
  • Generics: Uses const N: usize to unroll power calculations at compile time.

Trait Implementations§

Source§

impl<const N: usize> Clone for HydrogenBond<N>

Source§

fn clone(&self) -> HydrogenBond<N>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<const N: usize> Debug for HydrogenBond<N>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<const N: usize> Default for HydrogenBond<N>

Source§

fn default() -> HydrogenBond<N>

Returns the “default value” for a type. Read more
Source§

impl<T: Real, const N: usize> HybridKernel<T> for HydrogenBond<N>

Source§

fn energy(r_sq: T, cos_theta: T, (d_hb, r_hb_sq): Self::Params) -> T

Computes only the potential energy.

§Formula

$$ E = D_{hb} (5s^6 - 6s^5) \cos^N \theta, \quad \text{where } s = (R_{hb}/r)^2 $$

Source§

fn diff(r_sq: T, cos_theta: T, (d_hb, r_hb_sq): Self::Params) -> (T, T)

Computes only the derivative factors.

§Formula

$$ D_{rad} = \frac{60 D_{hb}}{r^2} (s^6 - s^5) \cos^N \theta, \quad \text{where } s = (R_{hb}/r)^2 $$ $$ D_{ang} = N E_{rad} \cos^{N-1} \theta $$

  • force_factor_rad ($D_{rad}$): Used to compute the central force along the D-A axis: $ \vec{F}_{rad} = -D_{rad} \cdot \vec{r}_{DA} $
  • force_factor_ang ($D_{ang}$): Used to compute torque-like forces on the D-H-A angle via the Wilson B-matrix gradient chain rule: $ \vec{F}_i = -D_{ang} \cdot \nabla_i (\cos\theta) $
Source§

fn compute( r_sq: T, cos_theta: T, (d_hb, r_hb_sq): Self::Params, ) -> HybridEnergyDiff<T>

Computes both energy and derivative factors efficiently.

This method reuses intermediate calculations to minimize operations.

Source§

type Params = (T, T)

Associated constants/parameters required by the potential.
Source§

impl<const N: usize> Copy for HydrogenBond<N>

Auto Trait Implementations§

§

impl<const N: usize> Freeze for HydrogenBond<N>

§

impl<const N: usize> RefUnwindSafe for HydrogenBond<N>

§

impl<const N: usize> Send for HydrogenBond<N>

§

impl<const N: usize> Sync for HydrogenBond<N>

§

impl<const N: usize> Unpin for HydrogenBond<N>

§

impl<const N: usize> UnwindSafe for HydrogenBond<N>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.