[lammps-users] Visualize LAMMPS metadata in VMD.

Dear all,

In my research I study metals under strained conditions, and I normally use VMD (Visual Molecular Dynamics) to visualize the result of my simulations. This is a very nice way to see atoms and their movements, and VMD can read my dump file directly, which is great.

However, in my dump file I also have many other per-atom properties, like potential energy, total displacement and neighbor analysis parameters, and I would very much like to visualize this using VMD. For instance, that the atoms can be colored according to their potential energy using some colorscale, to see where the energy is large. Ideally I would also like to use the "Selected atoms" box in VMD to restrict what atoms are shown based on this metadata. (For instance, only show atoms having potential energy in a certain range.)

So far I have used AtomEye in order to visualize my custom metadata, but this requires writing my own scripts for converting my LAMMPS dump files into a format that is readable in AtomEye. Also, AtomEye only reads one snapshot at a time, and cannot show the trajectory as the simulation evolves. I wish that I could color the atoms according to custom properties, but by using VMD, so the movement of the atoms is directly viewable.

I hope someone here has some experience with this, and can give some help or comments.

Thanks,
Christer H. Ersland.

Dear all,

dear christer,

In my research I study metals under strained conditions, and I normally use VMD (Visual Molecular Dynamics) to visualize the result of my simulations. This is a very nice way to see atoms and their movements, and VMD can read my dump file directly, which is great.

However, in my dump file I also have many other per-atom properties, like potential energy, total displacement and neighbor analysis parameters, and I would very much like to visualize this using VMD. For instance, that the atoms can be colored according to their potential energy using some colorscale, to see where the energy is large. Ideally I would also like to use the "Selected atoms" box in VMD to restrict what atoms are shown based on this metadata. (For instance, only show atoms having potential energy in a certain range.)

So far I have used AtomEye in order to visualize my custom metadata, but this requires writing my own scripts for converting my LAMMPS dump files into a format that is readable in AtomEye. Also, AtomEye only reads one snapshot at a time, and cannot show the trajectory as the simulation evolves. I wish that I could color the atoms according to custom properties, but by using VMD, so the movement of the atoms is directly viewable.

I hope someone here has some experience with this, and can give some help or comments.

yes. on both counts.

first, VMD reads coordinate data through its so-called molfile
plugins. the molfile API thus defines
what and how data is relayed from the original file to what VMD stores
internally. since VMD was
initially written to visualize results from classical molecular
dynamics simulations of biosystems,
it data model makes certain assumptions that are only true for those
kinds of simulations. there
have been improvements over the years, but the main intention is to
extend functionality only so
far as it either does not hurt the performance and memory consumption
for existing use or if the
gains in functionality are huge.

with that in mind VMD normally stores most atom properties once per
system and not per timestep.
the exception to that are coordinates and (as of recently) velocities.
the lammpstrj reader in
VMD-1.8.7 should support both. further per timestep properties can be
stored in the user
(and user1, user2, user3) fields, but for those, there is not yet a
way to assign them from reading
the lammpstrj file directly. however, they can be set from tcl script
with the help of atom selections.

so the current general solution to get additional per timestep
properties into VMD would be to
write a parser for your dump files in tcl and then pick column that
you want to use and copy
them into a user field. these user fields can be used for selection
and colorization.
the downside of this method is that parsing large text files is slow
and even slower
when done in tcl.

in the current cvs version of the lammpstrj plugin i have added a
feature that you can remap
data columns when reading lammps custom dump files. i.e. you could
assign the properties
you want to read into VMD to the vx, vy, or vz field.

it is planned to have the molfile plugin API extended so that generic
data can be passed
on to VMD, but that is far from trivial, if this has to be done while
maintaining backward
compatibility and efficiency.

cheers,
    axel.

Re: AtomEye, LAMMPS has a dump cfg command which
write AtomEye compatible files with extra columns of metadata.
AtomEye also does animations from multiple shapshots - I've seen them.

Steve