Invalid atom ID in Bonds section of data file (src/atom.cpp:1282)

I’m working on a model of a particular polymer that was built using moltemplate. But, when I try to simulate it, LAMMPS finds an error already in the data scanning.

# ----------------- Atom Definition Section -----------------

read_data "system.data"
Reading data file ...
  orthogonal box = (0.0000000 0.0000000 0.0000000) to (11772.070 11772.070 11772.070)
  1 by 1 by 1 MPI processor grid
  reading atoms ...
  201736 atoms
  scanning bonds ...
ERROR on proc 0: Invalid atom ID in Bonds section of data file (src/atom.cpp:1282)

In the Bonds section of system.data it is as follows.

Bonds

1 59 1 1
2 58 1 2
3 58 1 3
4 58 1 4
5 58 5 6
6 58 5 7
7 59 5 5
8 58 8 9
9 58 8 10
10 59 8 8
11 58 11 12
12 58 11 13
13 59 11 11
14 58 14 15
...

Would you be available to support me?
Very grateful for the attention.

I apologize if the issue has already been dealt with before, but I didn’t find it in my searches.

This error means that something went wrong when creating the data file and it is inconsistently formatted. It is impossible to say for certain what the exact error is based on the provided information.

You have a rather large system. Please try to create a (much) smaller one and see if you still get the same error. Please post the smallest possible data file that still shows that error.

P.S.: please always report which LAMMPS version you are using.

Ah wait… while normally it requires to check the entire file as most often the issue are inconsistent numbers or missing newlines or alike, it looks like in this case you have already included a problematic line.

The line quoted above has a bond of an atom with itself. That is invalid. That means that the input you provide to moltemplate is likely already invalid.

1 Like

I think the problem might be in the moltemplate genpoly. I will go back and check again.

I am using Patch release from 27 May 2021.

Thank you for the tip.