pub fn force(&self, r: f64) -> f64 {
        if r >= self.cutoff {
            0.0
        } else {
            self.potential.force(r)
        }
    }
/// Get the norm of the force for this pair interaction at the distance `r`.
///
/// # Examples
///
/// ```
/// use lumol_core::energy::PairInteraction;
/// use lumol_core::energy::Harmonic;
///
/// let potential = Box::new(Harmonic{x0: 0.5, k: 4.2});
/// let interaction = PairInteraction::new(potential, 2.0);
///
/// assert_eq!(interaction.force(1.0), -2.1);
/// // force at and after the cutoff is zero
/// assert_eq!(interaction.force(2.0), 0.0);
/// ```
Get the norm of the force for this pair interaction at the distance `r`.
Get the norm of the force for this pair interaction at the distance ` r ` .
pub fn force(&self, r: f64) -> f64 {
        if r >= self.cutoff {
            0.0
        } else {
            self.potential.force(r)
        }
    }
pub fn force ( & self , r : f64 ) -> f64 { if r >= self . cutoff { 0.0 } else { self . potential . force ( r ) } }
Get the norm of the force for this pair interaction at the distance `r`.
Get the norm of the force for this pair interaction at the distance ` r ` .
&self
r
f64
examples
```
use lumol_core::energy::PairInteraction;
use lumol_core::energy::Harmonic.

let potential = Box::new(Harmonic{x0: 0.5, k: 4.2});
let interaction = PairInteraction::new(potential, 2.0).

assert_eq!(interaction.force(1.0), -2.1);
force at and after the cutoff is zero
assert_eq!(interaction.force(2.0), 0.0);
```
` ` ` use lumol_core :: energy :: PairInteraction ; use lumol_core :: energy :: Harmonic . let potential = Box :: new ( Harmonic { x0 : 0 . 5 k : 4 . 2 } ) ; let interaction = PairInteraction :: new ( potential 2 . 0 ) . assert_eq! ( interaction . force ( 1 . 0 ) - 2 . 1 ) ; force at and after the cutoff is zero assert_eq! ( interaction . force ( 2 . 0 ) 0 . 0 ) ; ` ` `