[lammps-users] Converting LAMMPS dump files to dcd format

Is there a way to convert LAMMPS dump files to the binary dcd file format?
As far as I can tell, the pizza.py toolkit can convert only to the xyz and
vtk formats. If this does not exist yet, how hard would it be to add such
a module to pizza.py?

  Lutz

Is there a way to convert LAMMPS dump files to the binary dcd file format?

a) you can write .dcd directly

b) you can use a recent catdcd (see VMD homepage), provided your
  dump is in standard (not custom) text format.

axel.

To do it in Pizza.py, you'd need to write binary files. This is
possible from Python, but I've never done it.

Steve

I have a package I wrote 2 years ago that can parse lammps trajectory
files and write out a DCD file. It requires Numeric python (although it
should work with numpy, you probably just have to change the import
statement). I haven't used it since I implemented the dcd writing in
LAMMPS, but it should work. It also has the ability to remap the atoms so
that bonded molecules don't span the periodic cell.

Place the LAMMPS directory in a python accessibly path, and use the
lmptrjconv.py binary to convert to dcd.

If you just run the lmptrjconv.py script by itself you should get a list
of self-explanatory options.

Naveen

lammps2dcd.tar (40 KB)

By the way, it should be possible to pull out the DCDWriter class and use
it in pizza, as long as you pass an appropriate fortran formatted array of
coordinates (column-major format)

Also, the atom remapping functionality doesn't use bond lists to decide
what atoms are bonded. It just uses the molecule field in the LAMMPS data
file, and it just guarantees that a molecule won't span a periodic
boundary (each molecule must be contiguously specified in the data file
like with CHARMM).

Naveen