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

get_neighborhood does not work when cutoff_radius is specified #153

Open
samwaseda opened this issue Feb 23, 2024 · 0 comments
Open

get_neighborhood does not work when cutoff_radius is specified #153

samwaseda opened this issue Feb 23, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@samwaseda
Copy link
Member

It's actually a very rare case, but the following code does not work:

from pyiron_atomistics import Project
a_0 = 3.4812
structure = Project(".").create.structure.bulk('Fe', cubic=True, crystalstructure='fcc', a=a_0).repeat(5)
neigh = structure.get_neighbors(num_neighbors=12)
narrow_paths = structure.positions[:, None, :] + neigh.vecs * 0.5
narrow_paths = narrow_paths[neigh.indices > neigh.atom_numbers]
structure.get_neighborhood(narrow_paths, num_neighbors=None, cutoff_radius=5).distances.max()

Output : inf (while it should be some finite number since different points do not have different neighborhood)

The reason is get_extended_positions from structuretoolkit.common.helper does not correctly calculate the distance of external points to the nearest point in the box. I always knew that this could be a problem but I guess I should come up with a decent algorithm.

@samwaseda samwaseda added the bug Something isn't working label Feb 23, 2024
@samwaseda samwaseda self-assigned this Feb 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant