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 a bug of calculate_min_atomic_distance function #899

Merged
merged 1 commit into from
Feb 8, 2025

Conversation

BBBuZHIDAO
Copy link
Contributor

Summary

Function calculate_min_atomic_distance (#890 ) will not update min_n1 if all distances are larger than dist_sq. So there may be a memory error for many systems when reading the -1th atomic symbol from array cpu_atom_symbol.

Modification

Check min_n1 before print and use macro to set the limit of minimum distance

Others

I tested in $\mathrm{MoS_2}$. This function may need more other tests.

@brucefan1983 brucefan1983 marked this pull request as ready for review February 8, 2025 08:49
@brucefan1983 brucefan1983 merged commit 104a804 into brucefan1983:master Feb 8, 2025
2 checks passed
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.

2 participants