From: Lutz Maibaum (
Date: Tue Oct 03 2006 - 11:49:23 CDT


yesterday I sent an email saying that the LAMMPS plugin might have a problem
reading dump files in which the atoms are not sorted by ascending atom-id.
Files of that form are generated when LAMMPS is running on more than one

I played around with the code for a little while, and for me the following
patch to the function read_lammps_structure in lammpsplugin.c (and
lammpspluginA.c) solves my problem:

< if ((atomid <= 0) || (atomid > data->numatoms))
< {
< fprintf(stderr, "lammpsplugin) Error while reading structure from
lammps dump file '%s': atomid %d is not in valid range [1,
%d]\n",data->file_name, atomid, data->numatoms);
< }
< atom = atoms + atomid - 1;

>     atom = atoms + i;
I believe that in this function the atom type was not assigned to the atom-id, 
but just to an increasing index number. The above patch should fix that. I 
don't know anything about the vmd code, so maybe someone could look over this 
patch. If this works then the documentation should reflect the fact that the 
LAMMPS plugin also conserves the atom types, and not just the positions.