dreid_kernel/types.rs
1use crate::math::Real;
2
3/// Standard output for most potentials (2-body, 3-body, 4-body).
4///
5/// Contains the scalar potential energy and a single derivative factor
6/// used to compute forces or torques in the upper geometry layer.
7#[repr(C)]
8#[derive(Debug, Clone, Copy, Default, PartialEq)]
9pub struct EnergyDiff<T: Real> {
10 pub energy: T,
11 pub diff: T,
12}
13
14/// Specialized output for Hybrid potentials (e.g., Hydrogen Bonds).
15///
16/// Hybrid potentials depend on both distance (r) and angle (theta),
17/// producing two distinct derivative factors for force distribution.
18#[repr(C)]
19#[derive(Debug, Clone, Copy, Default, PartialEq)]
20pub struct HybridEnergyDiff<T: Real> {
21 pub energy: T,
22
23 /// Radial force factor: `-(1/r * dE/dr)`
24 /// Used to compute forces along the D-A vector.
25 pub force_factor_rad: T,
26
27 /// Angular force factor: `dE/d(cos)`
28 /// Used to compute torque-like forces on D-H-A via Wilson B-Matrix.
29 pub force_factor_ang: T,
30}