Write_data + read_data, delete atoms-error-input files attached

Arun,

I am not quite sure what you meant about not working with read_data command with new data file written by write_data command. Just simply change read_data section in your in.step2b file like,

read_data data.ethane_delete from read_data data.step2b

Since data.ethane_delete file is the data file written by write_data command, it should work with this change if you correct the number of dihedrals in the data file. I tested your files, it worked.

Maybe, you need “loop local” in the velocity section of input file.

Two tests

  1. in.step2b and data.step2b <— worked

  2. in.step2b and data.ethane_delete <-----worked when I correct the number of dihedrals (432->423) in the top of data file

C.W

Arun,

I am not quite sure what you meant about not working with read_data command with new data file written by write_data command. Just simply change read_data section in your in.step2b file like,

The point is that one should not need to modify the file. Lammps should write a consistent file.

Axel,

Arun,

Arun,

Yes the second test worked !. Thanks, but it shouldn’t be necessary to edit the data file after atom deletion for the right number of dihedrals.

Why not changing the proper dihedral numbers in the data file in order to run a simulation if there is a bug with lammps?

I am not sure why you and Axel used the word “Should not”. This is a useful method if the problem is not your fault.

Because bugs need fixing and this is what this discussion is about. Arun already mentioned a much cleaner workaround, using a restart file.

thanks to the complete input deck provided by arun (i was mislead by
your description somehow), i have been able to identify a fix to the
source code that should remove the inconsistent behavior.

this one line change to the source should result in the correct behavior:

diff --git a/src/delete_atoms.cpp b/src/delete_atoms.cpp
index 7907961..9e5f357 100644
--- a/src/delete_atoms.cpp
+++ b/src/delete_atoms.cpp
@@ -109,7 +109,7 @@ void DeleteAtoms::command(int narg, char **arg)
     atom->map_set();
   }

- if (mol_flag) recount_topology();
+ recount_topology();

   // print before and after atom and topology counts

axel.