Write_data + read_data, delete atoms-error- proof of two test cases

Thank you very much Andrew for replying. Yes the number of atoms listed on top of the file and the number of lines in the atoms section in the read data file are matching.

But if you look at the read_data.cpp file, the error is about the number of dihedrals. In my opinion, I think the write_data command does not update the dihedral information after deletion of atoms (well, I may be wrong).

However to test, I considered two cases

  1. Take a simple lj system (in.lj, readily available). use group and delete_atoms command. ( I deleted some of the atoms arbitrarily), write out a data file and try to read it using read_data. It worked, since it does not have any dihedrals.

  2. Take another example which is readily available from Dr.Axel’s website on topotools, simulation of ethane molecule (this has dihedrals). Again write out a data file after deleting atoms arbitrarily. Now try using the read_data command !.
    Again the same error as I previously posted.
    “unexpected …”

If you compare the data files, the number of dihedrals remain the same before and after deletion of some of the atoms except for the atom numbers !!.

Now use Dr. Axel’s topo tools to read in the datafile (the datafile outputted after atom deletion). The topo tool is able to read the data file (I don’t why though) without any errors. After that, you can use a command like

“topo write lammpsdata data.foo”.

Have a look at the number of dihedrals in data.foo. It is different from the data file that lammps outputted after the use of delete_atoms command!!!

It took a lot of time going through the mailing list to find the cause of this error.
write_data command does not update dihedrals after atom-deletion.


Are you using an up-to-date version of lammps? This sounds a lot like a bug that was recently fixed.