Outputting LAMMPS trajectory file

I output a lammps trajectory file using commands such as these:

dump apf all custom 1000 atom_position.dat id type x y z ix iy iz

dump trjfile all custom 1000 dump.lammpstrj id mol type x y z ix iy iz

There is a lot of space between each molecule, but the density is exactly what it should be. I believe this box is “unwrapped”, as in the periodic boundary conditions are applied here. If it was “wrapped”, the molecules should take the shape of a cube. How can I output atom positions and a lammps trajectory file that would be in the correct cube arrangement that have not undergone any “unwrapping”?

Thanks in advance,

J. Berry

P.S. : a picture is attached in this email to show the space between the molecules.

18F14404A3B941DA85E22D4DE2E3215A.png

I output a lammps trajectory file using commands such as these:

dump apf all custom 1000 atom_position.dat id
type x y z ix iy iz

dump trjfile all custom 1000 dump.lammpstrj id mol type
x y z ix iy iz

There is a lot of space between each molecule, but the density is exactly
what it should be. I believe this box is “unwrapped”, as in the periodic
boundary conditions are applied here. If it was “wrapped”, the molecules
should take the shape of a cube. How can I output atom positions and a
lammps trajectory file that would be in the correct cube arrangement that
have not undergone any “unwrapping”?

​the x,y, and z coordinate properties are always "wrapped" coordinates. the
"unwrapping" happens if a) you output the image flags (ix, iy, and iz) and
b) you are using a trajectory reader code, that uses this image flag
information to unwrap your trajectory.

thus to avoid the unwrapping, you could simply remove the image flags from
the list of properties to write out. however, that will lead to wrapping
*by atom*, which will "break" your molecules and will lead or missing or
"strange" bonds​ depending on where you obtain your bond information from.

it is generally considered best practice to write out an unwrapped
trajectory and then do the wrapping as needed in post-processing. this
maintains the maximum of information in your trajectory. in fact, if you
head over to the VMD mailing list, then you'll see plenty of discussions
started by people that have wrapped trajectories and are now desperately
looking for ways to "rebuild" their molecules or fully "unwrap" their
trajectories again.

axel.

18F14404A3B941DA85E22D4DE2E3215A.png