Changed pbc_points to allow to shift the box in the other direction for shear simulations.
This commit is contained in:
parent
8146a9b270
commit
76e44dde49
@ -241,9 +241,7 @@ def nojump(frame, usecache=True):
|
|||||||
return frame - delta
|
return frame - delta
|
||||||
|
|
||||||
|
|
||||||
def pbc_points(
|
def pbc_points(coordinates, box, thickness=0, index=False, shear=False):
|
||||||
coordinates, box, thickness=0, index=False, shear=False, extra_image=False
|
|
||||||
):
|
|
||||||
"""
|
"""
|
||||||
Returns the points their first periodic images. Does not fold
|
Returns the points their first periodic images. Does not fold
|
||||||
them back into the box.
|
them back into the box.
|
||||||
@ -253,22 +251,14 @@ def pbc_points(
|
|||||||
originals values.
|
originals values.
|
||||||
"""
|
"""
|
||||||
if shear:
|
if shear:
|
||||||
box[2, 0] = box[2, 0] % box[0, 0]
|
box[2, 0] = box[2, 0] % box[2, 2]
|
||||||
if shear or extra_image:
|
if box[2, 0] > box[2, 2]:
|
||||||
grid = np.array(
|
box[2, 0] = box[2, 0] - box[2, 2]
|
||||||
[
|
|
||||||
[i, j, k]
|
grid = np.array(
|
||||||
for k in [-2, -1, 0, 1, 2]
|
[[i, j, k] for k in [-1, 0, 1] for j in [1, 0, -1] for i in [-1, 0, 1]]
|
||||||
for j in [2, 1, 0, -1, -2]
|
)
|
||||||
for i in [-2, -1, 0, 1, 2]
|
indices = np.tile(np.arange(len(coordinates)), 27)
|
||||||
]
|
|
||||||
)
|
|
||||||
indices = np.tile(np.arange(len(coordinates)), 125)
|
|
||||||
else:
|
|
||||||
grid = np.array(
|
|
||||||
[[i, j, k] for k in [-1, 0, 1] for j in [1, 0, -1] for i in [-1, 0, 1]]
|
|
||||||
)
|
|
||||||
indices = np.tile(np.arange(len(coordinates)), 27)
|
|
||||||
coordinates_pbc = np.concatenate([coordinates + v @ box for v in grid], axis=0)
|
coordinates_pbc = np.concatenate([coordinates + v @ box for v in grid], axis=0)
|
||||||
size = np.diag(box)
|
size = np.diag(box)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user