Skip to main content

cons_laws/
_zero.rs

1use super::{ExternalVelocity, Interaction, Mobility};
2
3pub struct ZeroVelocity;
4pub struct ZeroInteraction;
5pub struct OneMobility;
6
7impl<T, X> ExternalVelocity<T, X> for ZeroVelocity
8where
9    X: num_traits::Zero,
10{
11    #[inline]
12    fn eval(&self, _t: T, _x: X) -> X {
13        X::zero()
14    }
15}
16
17impl<T, X> Interaction<T, X> for ZeroInteraction
18where
19    X: num_traits::Zero,
20{
21    #[inline]
22    fn eval<P>(&self, _t: T, _x: X, _p: P) -> X
23    where
24        P: IntoIterator<Item = X>,
25    {
26        X::zero()
27    }
28}
29
30impl<T, X> Mobility<T, X> for OneMobility
31where
32    X: num_traits::One,
33{
34    #[inline]
35    fn eval(&self, _t: T, _x: X) -> X {
36        X::one()
37    }
38}