# Unwrapped coordinate or wrapped one

Dear all,

I’m a little bit confusing with the unwrapped coordinate and wrapped coordinate. I find the definition of unwrapped coordinate in the manual of damp command as :

" Unwrapped means that if the atom has passed thru a periodic boundary one or more times, the value is printed for what the coordinate would be if it had not been wrapped back into the periodic box. Note that using xu, yu, zu means that the coordinate values may be far outside the box bounds printed with the snapshot."

So does it mean that if the periodic boundary is at y=0 and y=5 and an atom moves from y=3 to y=6, the unwrapped coordinate will be y=6 and the wrapped coordinate will be y=1? If it is correct, then the following problems appear.

Since atom->x store the wrapped coordinate, if I need to calculate interaction between each atom pairs, do i must use unmap to get unwrapped coordinate? I fine in pair st
yles, the wrapped coordinate atom->x is used but in a fix named fix…efield, unwrapped coordinates are used for calculating added potential energy due to efield.

Dear all,

I'm a little bit confusing with the unwrapped coordinate and wrapped
coordinate. I find the definition of unwrapped coordinate in the manual of
damp command as :

" Unwrapped means that if the atom has passed thru a periodic boundary one
or more times, the value is printed for what the coordinate would be if it
had not been wrapped back into the periodic box. Note that using xu, yu, zu
means that the coordinate values may be far outside the box bounds printed
with the snapshot."

So does it mean that if the periodic boundary is at y=0 and y=5 and an atom
moves from y=3 to y=6, the unwrapped coordinate will be y=6 and the wrapped
coordinate will be y=1? If it is correct, then the following problems
appear.

it is correct and not correct. for *local* atoms, this is (mostly)
true. the atom position arrays will be "rewrapped" and the image flags
updated each time before a new set of neighbor lists is computed. if
this is not done at every step, then atoms may move outside the box
for a little bit. but in general that is true. however, each parallel
subdomain also has "ghost" atoms and thus may be (explicit) periodic
copies.

Since atom->x store the wrapped coordinate, if I need to calculate
interaction between each atom pairs, do i must use unmap to get unwrapped
coordinate? I fine in pair st

not automatically. when you use a neighbor list, the neighbor list
class will automatically find the closest neighbors for you and will
automatically detect whether this is a "local" or a "ghost" atom (i.e.
a copy from a neighboring subdomain or a periodic image).

yles, the wrapped coordinate atom->x is used but in a fix named fix…efield,
unwrapped coordinates are used for calculating added potential energy due to
efield.

if you look more closely, you'll see that the unwrapping is only done
for constant field. when you use a (possibly constant) variable, the
unwrapping does not happen (currently). it would probably be a good
idea to have this a) documented and b) make the wrap/unwrap behavior
selectable.

axel.