pub struct PlanarInversion;Expand description
Planar inversion potential for sp² centers.
§Physics
Models planarity for sp² hybridized atoms (e.g., aromatic carbons, carbonyl groups). The central atom $I$ is bonded to three neighbors $J, K, L$, and the potential penalizes any out-of-plane displacement.
- Formula: $$ E = \frac{1}{2} C \cos^2\psi $$
- Derivative Factor (
diff): $$ \Gamma = \frac{dE}{d(\cos\psi)} = C \cos\psi $$
§Parameters
c_half: Half force constant $C_{half} = C/2$.
§Inputs
cos_psi: Cosine of the out-of-plane angle $\psi$.
§Implementation Notes
- Optimized for $\cos\psi_0 = 0$: avoids one subtraction per evaluation.
- Pure polynomial evaluation; no trigonometric functions required.
- All intermediate calculations are shared between energy and force computations.
- Branchless and panic-free.
- DREIDING convention: force constant $C = K_{inv}/3$ (split among three permutations).
Trait Implementations§
Source§impl<T: Real> AngleKernel<T> for PlanarInversion
impl<T: Real> AngleKernel<T> for PlanarInversion
Source§fn diff(cos_psi: T, c_half: Self::Params) -> T
fn diff(cos_psi: T, c_half: Self::Params) -> T
Computes only the derivative factor $\Gamma$.
§Formula
$$ \Gamma = 2 C_{half} \cos\psi $$
This factor allows computing forces via the chain rule: $$ \vec{F} = -\Gamma \cdot \nabla (\cos\psi) $$
Source§fn compute(cos_psi: T, c_half: Self::Params) -> EnergyDiff<T>
fn compute(cos_psi: T, c_half: Self::Params) -> EnergyDiff<T>
Computes both energy and derivative factor efficiently.
This method reuses intermediate calculations to minimize operations.
Source§impl Clone for PlanarInversion
impl Clone for PlanarInversion
Source§fn clone(&self) -> PlanarInversion
fn clone(&self) -> PlanarInversion
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PlanarInversion
impl Debug for PlanarInversion
Source§impl Default for PlanarInversion
impl Default for PlanarInversion
Source§fn default() -> PlanarInversion
fn default() -> PlanarInversion
Returns the “default value” for a type. Read more
impl Copy for PlanarInversion
Auto Trait Implementations§
impl Freeze for PlanarInversion
impl RefUnwindSafe for PlanarInversion
impl Send for PlanarInversion
impl Sync for PlanarInversion
impl Unpin for PlanarInversion
impl UnwindSafe for PlanarInversion
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