[lammps-users] how to view lammps dump file in VMD


I am trying to use VMD to view the lammps dump file. I was able to load the dump file to VMD, but there is nothing shown on the VMD OpenGL Display. I’d appreicate if anyone can share experience using VMD, or any other windows tools that can view the lammps dump file.


You’ve got several options:

  1. Have LAMMPS dump xyz file format. See: http://www.cs.sandia.gov/~sjplimp/lammps/doc/dump.html
    Then read in the dump file directly into VMD. This should work OK and is easy.

  2. Have LAMMPS dump dcd file format. See: http://www.cs.sandia.gov/~sjplimp/lammps/doc/dump.html The down-side here is that you also need a CHARMM psf file. VMD has a psfgen module that can create these from pdb files. The advantage is that dcd files are more compact. And if you’re simulating biomolecules, much of the bio info is preserved.

  3. Convert your normal LAMMPS dump into pdb files. There are several utilities that do this. Check the tools/ch2lmp folder. for lammps2pdb.pl for one example. You can also use pizza.py to do this: http://www.cs.sandia.gov/~sjplimp/pizza.html

That gives you three routes. I’m sure there are more. I think VMD has a module for reading in LAMMPS dump files, but it may be outdated, or require a psf. I’ve never used it.


It is possible to read in LAMMPS' dump format using VMD, but I believe it
only reads in the dump atom format, not the dump custom. Also, you need to
make sure the coordinates are not scaled (dump_modify 1 scale no) and you
might need a structure file (either a charmm psf file or a pdb file, if
you are simulating a protein). Unfortunately, VMD doesn't yet read a
LAMMPS data file (from where it can glean bond connectivity, which is all
you really need to properly display molecules in VMD).

I've included a python script that can read in a LAMMPS data file and spit
out a properly formated psf file (also a pdb file, which is useful to
quickly look at the system you will simulate with LAMMPS), although none
of the atom or residue names will be correct (since this information isn't
found in a lammps data file). The only requirements are Numeric Python or
numpy. Type "lammps2pdbpsf -h" to see the available options. It's not too
robust, but it should work on most lammps data files.


lammps2pdbpsf.py (9.07 KB)

The Pizza.py package (linked from the LAMMPS WWW page) has
dump and pdb tools that work together to convert a LAMMPS dump
file into a series of PDB files (using your initial PDB file as a template).
It would take care of all scaling issues, etc.

You don't have to install all of Pizza.py to use them, just those 2 tools.


The problem with pdb files is that they don't contain any connectivity
info, so if you aren't simulating a standard biomolecule (protein or
nucleic acid) vmd will use distance criteria to decide if two atoms
are bonded, which can sometimes lead to strange looking molecules.

Also, a series of pdb files takes up more disk space and is more difficult
to manage than a single dump file.