Error from including charges in 'Atoms' section: Incorrect atom format in data file (../atom.cpp:540)

Hello all,

I am using the 12 April 2013 version of LAMMPS. I have searched for my error, but could not find anybody who had the same problem. I actually have conflicting errors here. I can "fix" one, but the fix causes the other and vice versa. This error ( Incorrect atom format in data file (../atom.cpp:540) ) appears when I use a data file whose atom section includes the charges, like this:

Atoms

1 1 2 -0.180000 -18.236025 -20.571995 -11.009017 # CT TTA
2 1 3 0.000000 -17.356035 -19.491997 -11.479018 # CZ TTA
3 1 3 0.000000 -16.616014 -18.611998 -11.859023 # CZ TTA
4 1 1 0.000000 -15.726030 -17.561996 -12.309020 # C TTA
...

However, if I eliminate the charges column, the error goes away. The 'Atoms' section then looks like this:

Atoms

1 1 2 -18.236025 -20.571995 -11.009017 # CT TTA
2 1 3 -17.356035 -19.491997 -11.479018 # CZ TTA
3 1 3 -16.616014 -18.611998 -11.859023 # CZ TTA
4 1 1 -15.726030 -17.561996 -12.309020 # C TTA
...

In its place, I get another error: "Pair style lj/cut/coul/dsf requires atom attribute q (../pair_lj_cut_coul_dsf.cpp:266)". Obviously, this is a result of a command in my input file:

pair_style lj/cut/coul/dsf 0.2 9.0 12.0

This makes sense - of course the charges are required to compute coulombic forces. I just can't figure out why the format is wrong when I try to include them. I used Dr. Kohlmeyer's tutorials to help me do this: https://sites.google.com/site/akohlmey/software/topotools/topotools-tutorial---introduction. I compared my input files to those used in the second part of the tutorials. They also include the charges section, and I completed the tutorials without any issue. I hope I'm not missing something obvious here, but I'm a little baffled. If anyone can spot my mistake, I'd greatly appreciate the help.

In case it's relevant, my data file was put together in VMD 1.9.1 with topotools, using the command,

topo writelammpsdata data.TTA full

in a .tcl script. I change "full" to "molecular" to get rid of the charges section.

Thanks very much,
N.H.

Hello all,

I am using the 12 April 2013 version of LAMMPS. I have searched for my error, but could not find anybody who had the same problem. I actually have conflicting errors

this LAMMPS version is *waaay* outdated.

here. I can "fix" one, but the fix causes the other and vice versa. This error ( Incorrect atom format in data file (../atom.cpp:540) ) appears when I use a data file whose atom section includes the charges, like this:

Atoms

1 1 2 -0.180000 -18.236025 -20.571995 -11.009017 # CT TTA
2 1 3 0.000000 -17.356035 -19.491997 -11.479018 # CZ TTA
3 1 3 0.000000 -16.616014 -18.611998 -11.859023 # CZ TTA
4 1 1 0.000000 -15.726030 -17.561996 -12.309020 # C TTA
...

However, if I eliminate the charges column, the error goes away. The 'Atoms' section then looks like this:

Atoms

1 1 2 -18.236025 -20.571995 -11.009017 # CT TTA
2 1 3 -17.356035 -19.491997 -11.479018 # CZ TTA
3 1 3 -16.616014 -18.611998 -11.859023 # CZ TTA
4 1 1 -15.726030 -17.561996 -12.309020 # C TTA
...

In its place, I get another error: "Pair style lj/cut/coul/dsf requires atom attribute q (../pair_lj_cut_coul_dsf.cpp:266)". Obviously, this is a result of a command in my input file:

pair_style lj/cut/coul/dsf 0.2 9.0 12.0

This makes sense - of course the charges are required to compute coulombic forces. I just can't figure out why the format is wrong when I try to include them. I used Dr. Kohlmeyer's tutorials to help me do this: https://sites.google.com/site/akohlmey/software/topotools/topotools-tutorial---introduction. I compared my input files to those used in the second part of the tutorials. They also include the charges section, and I completed the tutorials without any issue. I hope I'm not missing something obvious here, but I'm a little baffled. If anyone can spot my mistake, I'd greatly appreciate the help.

the problem is that your data file is not compatible with the old
version of LAMMPS. the problem is in the comments in each line. those
are not properly recognized and ignored by your LAMMPS version, rather
it complains (for this version correctly) that the data file is not
compatible with it.

In case it's relevant, my data file was put together in VMD 1.9.1 with topotools, using the command,

topo writelammpsdata data.TTA full

in a .tcl script. I change "full" to "molecular" to get rid of the charges section.

it is not relevant, but you need to update your topotools package to
avoid bugs that have since been fixed. the easiest path to update
topotools is to update VMD.

Dr. Kohlmeyer,

Thank you for your suggestions. I updated both VMD (1.9.2 now) and LAMMPS (22 Dec. 2014 -- the Windows 64-bit installer package) and gave it another go. I re-ran my .tcl script in VMD but it looks the same. And when I ran the input file with lmp_serial.exe, I got the same error I was getting before, except this time with a different number -- "(../atom.cpp:744)". So, to try to confirm that the comments were causing problems, I shrank my simulation to 1 molecule (before it was 216) so that I could manually delete all of the comments. I then tried to run the input file again, but received the same error. I think I must have done something else wrong, but I still can't figure out what.

Thanks for your help,
N.H.

Dr. Kohlmeyer,

Thank you for your suggestions. I updated both VMD (1.9.2 now) and LAMMPS (22 Dec. 2014 -- the Windows 64-bit installer package) and gave it another go. I re-ran my .tcl script in VMD but it looks the same. And when I ran the input file with lmp_serial.exe, I got the same error I was getting before, except this time with a different number -- "(../atom.cpp:744)". So, to try to confirm that the comments were causing problems, I shrank my simulation to 1 molecule (before it was 216) so that I could manually delete all of the comments. I then tried to run the input file again, but received the same error. I think I must have done something else wrong, but I still can't figure out what.

neither can we without a way to reproduce it.

Okay, I'm not sure what the character limit is, but I hope this fits. Here is a short version (only 1 molecule) of my data file, titled 'data.TTA'

LAMMPS data file. CGCMM style. atom_style full generated by VMD/TopoTools v1.5 on Mon Jan 19 16:14:37 -0500 2015
10 atoms
9 bonds
12 angles
8 dihedrals
1 impropers
7 atom types
7 bond types
8 angle types
6 dihedral types
1 improper types
-3.101000 3.689009 xlo xhi
-3.382000 4.157999 ylo yhi
-2.343992 2.326021 zlo zhi

# Pair Coeffs

Okay, I'm not sure what the character limit is, but I hope this fits. Here is a short version (only 1 molecule) of my data file, titled 'data.TTA'

LAMMPS data file. CGCMM style. atom_style full generated by VMD/TopoTools v1.5 on Mon Jan 19 16:14:37 -0500 2015

[...]

Then here are the first few lines of my input file, where LAMMPS is getting errors:

units real
boundary p p p
atom_style molecular

read_data data.TTA
pair_style lj/cut/coul/dsf 0.2 9.0 12.0

It fails on the 'read_data data.TTA' line.

well, please compare the first line of the data file with your
atom_style command.

if you write out a data file in the format for atom style full, but
then try to read it with atom style molecular, it *has* to produce an
error.
change it to "full" and there will be no error.

axel.