pub trait PairPotential {
// Required methods
fn energy(&self, r: Fix128) -> Result<Fix128, PairPotentialError>;
fn force(&self, r: Fix128) -> Result<Fix128, PairPotentialError>;
// Provided method
fn force_on_first(&self, d: Vec3Fix) -> Result<Vec3Fix, PairPotentialError> { ... }
}Expand description
A central pair potential U(r) and its radial force F(r) = −dU/dr.
Required Methods§
Provided Methods§
Sourcefn force_on_first(&self, d: Vec3Fix) -> Result<Vec3Fix, PairPotentialError>
fn force_on_first(&self, d: Vec3Fix) -> Result<Vec3Fix, PairPotentialError>
Force on the first particle of a pair separated by d = x_i − x_j:
F(|d|) d / |d|. The second particle receives the negative.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".