Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix small cutoff neighbor #2277

Merged
merged 5 commits into from
Oct 26, 2021

Conversation

chc273
Copy link
Contributor

@chc273 chc273 commented Oct 23, 2021

Summary

In the current cell list implementation for finding neighbors, the space is divided into ~O((cell length / cutoff)^3) cubes for fast neighbor finding. This causes issues when the user chooses unrealistic small or even zero cutoffs.

In this PR, I am doing the following:

  1. For reasonable cutoff (default to > 1.0 Angstrom), I am calculating the neighbors directly using the algorithm.
  2. For small cutoffs (e.g., < 1.0 Angstrom, including neg cutoffs), I am calculating the 1.0-cutoff neighbor list, and use a boolean mask to keep those neighbors having distances less than the cutoff afterward. This will also make sure that if the users input negative cutoff, the returned neighbors will be empty.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.6%) to 83.101% when pulling 00ecc46 on chc273:fix_small_cutoff_neighbor into 71c8ab8 on materialsproject:master.

@shyuep shyuep merged commit 5cdae05 into materialsproject:master Oct 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants