Added dnn to next_neighbors
This commit is contained in:
parent
97e29e6de3
commit
2615798088
@ -251,17 +251,20 @@ def next_neighbors(
|
|||||||
atoms = atoms % np.diag(box)
|
atoms = atoms % np.diag(box)
|
||||||
tree = KDTree(atoms, boxsize=np.diag(box))
|
tree = KDTree(atoms, boxsize=np.diag(box))
|
||||||
distances, indices = tree.query(
|
distances, indices = tree.query(
|
||||||
query_atoms, number_of_neighbors, distance_upper_bound=distance_upper_bound
|
query_atoms,
|
||||||
|
number_of_neighbors + dnn,
|
||||||
|
distance_upper_bound=distance_upper_bound,
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
atoms_pbc, atoms_pbc_index = pbc_points(
|
atoms_pbc, atoms_pbc_index = pbc_points(
|
||||||
query_atoms, box, thickness=distance_upper_bound+0.1, index=True, **kwargs
|
query_atoms, box, thickness=distance_upper_bound + 0.1, index=True, **kwargs
|
||||||
)
|
)
|
||||||
tree = KDTree(atoms_pbc)
|
tree = KDTree(atoms_pbc)
|
||||||
distances, indices = tree.query(
|
distances, indices = tree.query(
|
||||||
query_atoms, number_of_neighbors, distance_upper_bound=distance_upper_bound
|
query_atoms,
|
||||||
|
number_of_neighbors + dnn,
|
||||||
|
distance_upper_bound=distance_upper_bound,
|
||||||
)
|
)
|
||||||
indices = atoms_pbc_index[indices]
|
indices = atoms_pbc_index[indices]
|
||||||
|
|
||||||
return distances[:, dnn:], indices[:, dnn:]
|
return distances[:, dnn:], indices[:, dnn:]
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user