UnivariateForce

Trait UnivariateForce 

Source
pub trait UnivariateForce {
    // Required method
    fn force(&self, r: f64) -> f64;
}
Expand description

Computes force as a function of one variable.

An univariate force is a function only one variable. Often, this is distance between two points: $f(r)$, but it could be a distance from a point to a surface, or any other single variable. The direction of the resulting force vector depends on how the UnivariateForce is applied.

Implement UnivariateForce on a custom type or use one of the provided forces in univariate in MD simulations.

Required Methods§

Source

fn force(&self, r: f64) -> f64

Compute force as a function of one variable.

When the force is associated with a potential energy UnivariateEnergy, it must follow:

-\frac{\mathrm{d} U}{\mathrm{d} r}

Implementors§