write_data, dump and visualization

Dear all,

When visualizing my systems (with VMD), I find it more convenient to use LAMMPS data files (as written with write_data) since it contains all sorts of data such as molecules (residues), bonds, angles, periodic flags etc. It's been very useful for rendering images when I needed the box unwrapped and the bonds displayed as they are within LAMMPS (and not guessed by topotools).

But now I want to render animations of the dynamics. For example follow one molecule among the others along the simulation. So I need regular snapshots of the system, which I can't get (apparently) with write_data. What dump format would you advise instead? Would it be as convenient to use with VMD as data files are? Or maybe there is a way to get data files periodically?

Thank you.

You can write periodic restart files, then convert each

of them to data files after the run. There is a command

line option (-restart) to do this, so you can write

a shell script to loop over the files, and don’t need

a LAMMPS input script to do it.

Steve

Dear all,

When visualizing my systems (with VMD), I find it more convenient to use
LAMMPS data files (as written with write_data) since it contains all
sorts of data such as molecules (residues), bonds, angles, periodic
flags etc. It's been very useful for rendering images when I needed the
box unwrapped and the bonds displayed as they are within LAMMPS (and not
guessed by topotools).

But now I want to render animations of the dynamics. For example follow
one molecule among the others along the simulation. So I need regular
snapshots of the system, which I can't get (apparently) with write_data.
What dump format would you advise instead? Would it be as convenient to
use with VMD as data files are? Or maybe there is a way to get data
files periodically?

this is really more of a VMD question than a LAMMPS question.
the VMD visualization model is going back to running simulations with
NAMD, which uses the CHARMM model of files, where you have a .psf file
containing the topology information and then one or more .dcd files
containing only coordinates and possibly simulation cell data.

this matches well with using the data file in LAMMPS for the topology
information and then reading one or more dump files "into the same
molecule" in VMD. please refer to the VMD user's guide and the VMD
tutorials for details. the main differences here are: LAMMPS data
files have only numerical atom types (unless they have additional
information in comments in a way the topotools understands them) and
CHARMM style .psf files do not contain coordinate information. well,
it is very simple to generate a .psf file from a LAMMPS data file in
VMD, by just saving the data in .psf format.

as for suitable dump formats, there are multiple options. pretty much
all of them can be read in VMD. custom dumps, allow storing additional
data, which can be read into VMD with a trick as velocity vector
components. but also .dcd files or (compressed) .xtc files are
possible. i recommend against .xyz, as this loses cell information.

axel.

Thank you for the advice. I've tried Steve's suggestion and it works but I realize working with hundreds of separate data files is a bad idea: too tedious and when visualizing they will be considered as different systems and not as different time frames of the same system.
Axel, I didn't convert the LAMMPS data file into .psf but I loaded it with topotools and then loaded a standard trajectory dump file "into the same molecule" with mol addfile. After loading both files and doing unwrap -all, I have to delete the first frame since it corresponds to the data file and not to an actual trajectory step. More surprisingly I have to delete the last frame as well because the displayed bonds in this one are all tangled up, crossing the length of the box.
The resulting trajectory seems good enough but something still worries me. The trajectory dump file I load into the molecule has the following information: ATOMS id type x y z vx vy vz mass. I see no mention of periodic image flag or unwrapped coordinates. Yet the unwrap -all command seems to be working, how come ?
I suspect it is only unfolding the box according to the topology (residues) and not, actually, according to the atoms displacement. I suppose this equates to the same thing if all the periodic flag images are 0 or 1, as it is the case in the simulation I'm visualizing now. That would explain why the result looks good.
Would it solve the issue if I added ix, iy, iz in the dump? Or if I used the dcd format instead, as you mentioned?

Best regards,

Jonathan

https://sites.google.com/site/akohlmey/software/lammps-plugin
http://lammps.sandia.gov/doc/dump.html
http://lammps.sandia.gov/doc/dump_modify.html
http://www.ks.uiuc.edu/Research/vmd/plugins/pbctools/