pub struct CosineLinear;Expand description
Cosine Linear potential for bond angles with linear equilibrium geometry.
§Physics
Models the angle bending energy for atoms with linear equilibrium geometry ($\theta_0 = 180°$), using a simple linear function of the cosine of the angle.
- Formula: $$ E = C (1 + \cos\theta) $$
- Derivative Factor (
diff): $$ \Gamma = \frac{dE}{d(\cos\theta)} = C $$
§Parameters
c: Force constant $C$.
§Inputs
cos_theta: Cosine of the bond angle $\theta_{ijk}$.
§Implementation Notes
- Single multiply-add for energy; zero arithmetic for derivative.
- Pure polynomial evaluation; no trigonometric functions required.
- Branchless and panic-free.
Trait Implementations§
Source§impl<T: Real> AngleKernel<T> for CosineLinear
impl<T: Real> AngleKernel<T> for CosineLinear
Source§fn diff(_cos_theta: T, c: Self::Params) -> T
fn diff(_cos_theta: T, c: Self::Params) -> T
Computes only the derivative factor $\Gamma$.
§Formula
$$ \Gamma = C $$
This factor allows computing forces via the chain rule: $$ \vec{F} = -\Gamma \cdot \nabla (\cos\theta) $$
Source§fn compute(cos_theta: T, c: Self::Params) -> EnergyDiff<T>
fn compute(cos_theta: T, c: Self::Params) -> EnergyDiff<T>
Computes both energy and derivative factor efficiently.
This method reuses intermediate calculations to minimize operations.
Source§impl Clone for CosineLinear
impl Clone for CosineLinear
Source§fn clone(&self) -> CosineLinear
fn clone(&self) -> CosineLinear
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 CosineLinear
impl Debug for CosineLinear
Source§impl Default for CosineLinear
impl Default for CosineLinear
Source§fn default() -> CosineLinear
fn default() -> CosineLinear
Returns the “default value” for a type. Read more
impl Copy for CosineLinear
Auto Trait Implementations§
impl Freeze for CosineLinear
impl RefUnwindSafe for CosineLinear
impl Send for CosineLinear
impl Sync for CosineLinear
impl Unpin for CosineLinear
impl UnwindSafe for CosineLinear
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