Skip to main content

compute_angle_forces

Function compute_angle_forces 

Source
pub fn compute_angle_forces(
    positions: &[[f64; 3]],
    angles: &[HarmonicAngle],
) -> (Vec<[f64; 3]>, f64)
Expand description

Compute harmonic angle forces (CPU mock).

The angle θ at vertex j (between vectors r_ij and r_kj) is: cos θ = (r_ij · r_kj) / (|r_ij| |r_kj|)

Forces follow from the gradient of the harmonic angle potential.

Returns (forces, total_angle_energy).