Problems with bonds lengths when displaying periodic trajectories

lammps version:LAMMPS 64-bit 29Aug2024-MSMPI

After outputting the DATA file using the “write_data” command at the end of the input file and opening the data file with VMD, it was observed that the model spreads outward and some particles extend beyond the box (Fig. a). This may be due to LAMMPS outputting the actual trajectory of the particles. The “dump Dump1 all dcd 10000 prod.dcd; dump_modify Dump1 unwrap no” command was subsequently used to output the periodic particle trajectory file, which was then loaded into VMD. It was found that some bonds lengths were too long (Fig. b), which may be attributed to the periodic boundary conditions, which may cause this issue. Guidance on how to display the model and bonds lengths normally (e.g. Fig. c) would be appreciated.

I tried using “mol bondsrecalc all” in VMD; however, this did not resolve the issue.

This is really a VMD question and not a LAMMPS question. You will have more success posting to the VMD mailing list.

The cause of the “long” bonds is that VMD will maintain the original bond topology, yet you have instructed LAMMPS to output as wrapped coordinates, so when one atom leaves the box and its periodic image enters, you get those “long” bonds. This is expected behavior. This can be avoided by writing out unwrapped coordinates. See the dump_modify command.
That has its own issues for longer trajectories, but that is definitely and VMD issue.