incorrect atom format

Dear All,

I went into the error of
“Incorrect atom format in data file (…/atom.cpp:540)”

I’ve checked the mailing list archive and also the data_file format. I think everything in the format look normal and I have another file using exactly the same format which is able to run normally. Thus I am really confused of why I am getting this error message.

I’ve attached my code and part of the data file below to see if anyone would be able to help.

Appreciate any help!

Best,
Qianping
DATA*******
#100CH4_10x10x10

169200 atoms
116960 bonds
83440 angles
0 dihedrals
0 impropers

4 atom types
2 bond types
2 angle types
0 dihedral types
0 improper types

-0.7989600000000000 119.8350000000000 xlo xhi
-0.8631900000000000 119.85310000000000 ylo yhi
-1.0263800000000000 119.85310000000000 zlo zhi

Masses

1 15.9994
2 1.008
3 12.0107
4 1.008

Atoms

1 1 1 -1.1794 0 0 3.0060699
2 1 2 0.5897 -0.79896 0.0294 3.5324099
3 1 2 0.5897 -0.0294 0.79945 2.4804699
4 1 1 -1.1794 0 0 9.0239296
5 1 2 0.5897 0.79896 -0.0294 8.4975901
6 1 2 0.5897 0.0294 -0.79945 9.54953
7 1 1 -1.1794 0 2.32078 1.4220001

Dear All,

I went into the error of
"Incorrect atom format in data file (../atom.cpp:540)"

I've checked the mailing list archive and also the data_file format. I
think everything in the format look normal and I have another file using
exactly the same format which is able to run normally. Thus I am really
confused of why I am getting this error message.

really impossible to say.
in 99.99% of the cases that i have seen, there *still* was an error in
the format.

axel.

My guess after reading it, is that one of the lines in your DATA file
has the wrong number of columns/numbers. To find out where in your
DATA file the problem is.

Here is an opportunity to improve LAMMPS. Why does LAMMPS not print
out where the error occurred? (Either a line number, or an excerpt
from the DATA file.)

Fortunately, the error message indicates what line in the LAMMPS
source code where the error occurred. Currently you have to step
through the LAMMPS source code with a debugger or edit the LAMMPS code
to print out where the error occured in your data file.

Go to the line 540 from atoms.cpp in the "src" directory (in my
version it is on line 564. It sounds like you are using an old
version of LAMMPS).

Replace this text:
  if (nwords != avec->size_data_atom &&
      nwords != avec->size_data_atom + 3)
    error->all(FLERR,"Incorrect atom format in data file");

With this text:
  if (nwords != avec->size_data_atom &&
      nwords != avec->size_data_atom + 3) {
    char err_msg[65536];
    sprintf(err_msg,"Bad text from data file:\n\"%s\"\nIncorrect atom
format in data file\n", buf);
    error->all(FLERR,err_msg);
  }

This code compiles, although I have not tested it.

(If you are using windows, you are out of luck unless you know how to
compile LAMMPS on windows.)

I hope this helps.

Andrew

Makefile.ubuntu_dbg (811 Bytes)

Makefile.ubuntu_parallel (815 Bytes)