[lammps-users] How to view lammps trajectory by VMD

Hi all,

I am considering how to view the lammps trajectory file by VMD. Now I am using VMD 1.8.6 and the latest version of lammps, however, I don’t know what lammps trajectory plugin do when I want to view the trajectory, and it seems that before loading the trajectory a psf file of the system should be loaded. So can anyone tell me how to load lammps dump file into VMD to get these frame images, any tutorial or example for this task is appreciated!

Best regards!

Hi Zhimin,

to view the atomic trajectories first you have to dump them using the xyz option on the lammps input. Then you can view them on VMD by loading the xyz file.

Hope this helps

Jaime

I am considering how to view the lammps trajectory file by VMD. Now I am
using VMD 1.8.6 and the latest version of lammps, however, I don't know what
lammps trajectory plugin do when I want to view the trajectory, and it seems
that before loading the trajectory a psf file of the system should be
loaded. So can anyone tell me how to load lammps dump file into VMD to get
these frame images, any tutorial or example for this task is appreciated!

Pieter int'Veld has written a Perl script which generates .psf and .pdb
files from LAMMPS dump files. His email is [email protected]..., I'm sure
he'd be happy to share it with you.

Rob

Here are a few remarks about VMD's trajectory file reader. I have a
slightly modified version of VMD, but I think most of these should apply
to the current 1.8.6 version of VMD:

- VMD can natively read trajectories generated by LAMMPS's dump command
(choose "atom" as the dump style). VMD expects the atom coordinates to be
scaled to [0,1], which is the default.

- VMD will automatically recognize LAMMPS trajectory files if the file name
ends in ".lammpstrj".

- The LAMMPS atom type is translated to the atom's "type" field in VMD.

- The trajectory reader expects that atom ids in the trajectory file to be
in the range [1,N], where N is the number of atom records per timestep.
This means that if you want to output only a subset of M atom coordinates
in LAMMPS, their atom ids must be in the range [1,M].

In short, the LAMMPS command
       dump positions all atom 100 filename.lammpstrj
should generate a trajectory file that VMD will understand.

Hope this helps,

  Lutz

Thanks to Jaime, Rob and Lutz!

Now I can view the trajectory according to Lutz’s remark, and also get a copy of Pieter’s script, and I will have a try more.

Hi Zhimin,

You can also dump to the dcd format, which is the native format for the
Charmm and NAMD molecular dynamics programs, or the xtc format, which is a
compressed format native to Gromacs. An additional advantage is that the
trajectory sizes are smaller (since it's a single precision binary
format). However, the dcd and xtc formats only contains atomic positions,
and you must dump all the atoms in your system (since the atom tag
information is implicit in the position index). However, if desired it's
possible to modify the dump_dcd code to dump per atom velocities or forces
instead (or maybe make this an option for both of these formats).

The main disadvantage for LAMMPS is that neither format can be read by
pizza.py (although I have written a small python wrapper to read DCD files
- it could probably be adapted to the pizza toolset). However, with a psf
file it is possible to perform analyses with Charmm or VMD (it would be
nice if VMD could read LAMMPS's data file directly - maybe we can put a
feature request to them).

To use the dcd format,

dump positions dcd atom 100 filename.dcd

To use the xtc format:

dump positions xtc atom 100 filename.xtc [precision]

where precision can be specified - a value of 100 means that coordinates
are stored to 1/100 nanometer accuracy.

Incidentally, for Steve and Paul and others at Sandia, would it be
possible to add a community wiki to the LAMMPS website where the
collective LAMMPS community can contribute their knowledge and scripts
that they've developed while using LAMMPS?

Naveen

naveen,

[...]

- it could probably be adapted to the pizza toolset). However, with a psf
file it is possible to perform analyses with Charmm or VMD (it would be
nice if VMD could read LAMMPS's data file directly - maybe we can put a
feature request to them).

i have looked into extending LAMMPS support in the VMD molfile plugins
not so long ago. the main problem is: LAMMPS is too flexible. :wink:
to get all the information that VMD needs, it basically needs the
whole input to LAMMPS (including variables, scripts etc.) which is
not possible. it would be easier to teach LAMMPS writing a matching
.psf file and make it an option to the dcd/xtc/lammps dump output.
i have been thinking about this for a while but was up to now
held back due to teaching and administrative commitments...

there have been repeated discussions amongst 'high-end' VMD users
and developers to come up with a self-describing, flexible, low
memory, compressible, and fast to read file format, but this has
not yet left the planning stage. coming up with a file format that
can be used _efficiently_ for whole range of applications from
very large scale classical MD to quantum chemistry is not an easy task...

To use the dcd format,

dump positions dcd atom 100 filename.dcd

To use the xtc format:

dump positions xtc atom 100 filename.xtc [precision]

where precision can be specified - a value of 100 means that coordinates
are stored to 1/100 nanometer accuracy.

Incidentally, for Steve and Paul and others at Sandia, would it be
possible to add a community wiki to the LAMMPS website where the
collective LAMMPS community can contribute their knowledge and scripts
that they've developed while using LAMMPS?

in case setting up and running a wiki would be too much overhead,
there are a number of alternatives, e.g.:
- for VMD we use the BioCoRE framework to communicate larger files
  and for chats (one can create public projects, so that everybody
  can join).
- google groups offers wiki-like webpages and (small) file uploads.
  we are using that for CP2K.

cheers,
   axel.

Axel,

i have looked into extending LAMMPS support in the VMD molfile plugins
not so long ago. the main problem is: LAMMPS is too flexible. :wink:
to get all the information that VMD needs, it basically needs the
whole input to LAMMPS (including variables, scripts etc.) which is
not possible. it would be easier to teach LAMMPS writing a matching
.psf file and make it an option to the dcd/xtc/lammps dump output.
i have been thinking about this for a while but was up to now
held back due to teaching and administrative commitments...

From my experience with VMD, the only molecular properties really

necessary are the atom lists and the bond connectivity (at least for
simple visualization and geometric analyses). So a LAMMPS molfile plugin
would just need to read in those two sections from the LAMMPS data file. I
don't believe that VMD can handle atom additions or deletions (at least
not simply - you would have to write a tcl script to load different psfs).

For the wiki, setup should be fairly easy (especially using the opensource
MediaWiki, the software that powers Wikipedia) and usually just involves
extracting the program into a web accessible directory, setting some
permissions in the web server and configuring the wiki from within itself.
The main advantage of using a wiki is that most pieces of information only
have a single source (unlike google groups, where answers to questions can
span multiple threads) and anyone can access it using just a browser
(unlike BioCore which requires a specialized client and is more suited
to collaboration on single projects).

Naveen

Naveen,