Box wrap in 2D produces nan values

Issue #136 resolved
James Antonaglia created an issue

The following minimal example illustrates that freud.box.Box.wrap() does not handle wrapping correctly when the box object is set to be 2D:

import freud
import numpy as np

r = np.array([9,11,13],dtype=np.float32)
B = freud.box.Box(Lx=10,Ly=10,is2D=True)
print('Vector r is originally',r)
B.wrap(r)
print('Vector r is wrapped to',r)

# Try specifying Lz
r = np.array([9,11,13],dtype=np.float32)
B = freud.box.Box(Lx=10,Ly=10,Lz=10,is2D=True)
print('Now vector r is originally',r)
B.wrap(r)
print('Now vector r is wrapped to',r)
print('B.Lz =',B.getLz())

This was tested with the latest conda-available build of freud, tagged as version 0.6.1.

Comments (4)

  1. Log in to comment