Fixed shear correction in pbc_points

This commit is contained in:
Sebastian Kloth 2023-10-18 15:33:19 +02:00
parent 5aec83b358
commit 22287d167d

View File

@ -250,11 +250,11 @@ def pbc_points(coordinates, box, thickness=0, index=False, shear=False):
originals values.
"""
if shear:
box[2, 0] = box[2, 0] % box[2, 2]
box[2, 0] = box[2, 0] % box[0, 0]
# Shifts the box images in the other directions if they moved more than
# half the box length
if box[2, 0] > box[2, 2] / 2:
box[2, 0] = box[2, 0] - box[2, 2]
box[2, 0] = box[2, 0] - box[0, 0]
grid = np.array(
[[i, j, k] for k in [-1, 0, 1] for j in [1, 0, -1] for i in [-1, 0, 1]]