From: Axel Kohlmeyer (
Date: Wed Sep 28 2011 - 19:27:16 CDT

hi john,

On Wed, Sep 28, 2011 at 7:20 PM, <> wrote:
> Hi all,
> I'm visualising LAMMPS trajectories using VMD 1.9.
> The data I wish to visualise is a little odd, in the sense that it changes in an slightly unorthodox way; the number of atoms, and the "type" of the atoms, can change during the simulation.

> I discovered that VMD has problems with trajectories where the number of atoms can differ between frames, and I got around this by estimating an upper bound of the number of atoms which would be present. I then postprocess to effectively add a "buffer region" at the end of each frame to allow for expansion and contraction of the system. This seems to work okay, but my current problem occurs when the number of atoms is fixed throughout the simulation:

> I have not been able to discover a way to make VMD recognise certain changes over the course of the trajectory. I tell LAMMPS to write out the atom serial, molecule id, atom type and coordinates for each frame with the data sorted on the atom serial. I've tried reflecting the changes in the system by changing both the molecule id and the atom type for visualisation (ie I postprocess the "real" trajectory, and write an altered version for visualisation purposes), and VMD seems to simply use whatever information was present in the first frame of whatever trajectory it loaded.

yes. that is by design. this massively reduces the amount of memory that
VMD consumes for the - by far more common - case of this information
not changing over the course of a trajectory.

> I've verified this behaviour by writing single and multiple trajectory frames (before and after the changes occur), and when I deal with individual frames the data appears as I intended; where multiple frames are present, VMD does not reflect any changes in the system via altering the molecule id and/or atom type over the course of the trajectory.
> Is there a way to make VMD reflect such changes during a trajectory, and not simply use the data present in the initial trajectory frame? If this is not possible with a LAMMPS-style trajectory, is there a VMD-compatible trajectory format which does support such "dynamic" changes?

there are two options.
VMD currently only supports additional per frame information in the
x-,y-, and z-velocity component and the LAMMPS plugins supports this.
via remapping you can direct any property into one of those three
fields. see:
you can then make selections based on the vx,vy, or vz value
or use them for colorization or first copy them into one of the
user fields.

this still requires all frames to be of the same size.

the second option is to read a variable size .xyz trajectory through
the topotools plugin.
this does the "buffering" automatically, and you can reflect whatever
change you want
in the atom name. the drawback of this approach is that it - for
efficiency reasons -
does not preserve the order of atoms and thus does not work for
systems with bonds
(you can still try using VDW in combination with DynamicBonds). see:


> Thanks,
> John.

Dr. Axel Kohlmeyer
Institute for Computational Molecular Science
Temple University, Philadelphia PA, USA.