openkim / kliff

KIM-based Learning-Integrated Fitting Framework for interatomic potentials.
https://kliff.readthedocs.io
GNU Lesser General Public License v2.1
34 stars 20 forks source link

Fix neighborlist #38

Closed mjwen closed 2 years ago

mjwen commented 2 years ago

Neighbor list fails for 1D and 2D case where the span of the cell is zero in some directions as reported in #37.

This is caused by using std::numeric_limits<double>::epsilon() when checking the span, which is too small to be distinguishable. Fixed by setting tolerance to 10*epsilon.