positions outside periodic box


I’ve noticed that when I dereference the x array for the position of a neighbor with index j from some ith atom’s neighbor list it’ll produce a position outside of the periodic box limits. There’s no fix operating on the box (just a simple nve simulation) and I’m checking values in gdb. Are the ghost atoms adjusted when they’re outside the box? What could lead to neighbor positions outside the box for this simple simulation?

Is the position just barely outside of the box? I might remember incorrectly but I thought that LAMMPS rewraps the positions only when building a neighbour list, so for a short while, positions outside of the box are OK.

The coords of an image ghost atom whose real atom is on the other side of the

box, are adjusted by a box length. I.e. the coord of such a ghost

atom is supposed to be outside the box. That’s the way LAMMPS works.