Errors on different section titles when making data file in GUI

Hi Everyone,

I have been trying to run the code from this 2010 paper modeling water contact angles on graphene. When I run the input and data file from the paper, I am continuously met with errors no matter the troubleshooting/ rearrangement.

The following data file results in “ERROR: Invalid atom type in Masses section of data file: Pair Coeffs (src/read_data.cpp: 2111)” as if the following section title “Pair Coeffs” were in the place of an atom type.
When I move the Masses section to the end so that nothing follows it, I get the error “Expected integer parameter instead of ‘Angle/Pair/Bond (depending on the arrangement of the sections)’ in input script or data file (src/read_data.cpp:2581)”
How can I prevent these errors? It seems like no matter what I do (I’ve tried changing the number of atoms, adding spaces/comments) the section titles are as integers.

11376 atoms
4000 bonds
2000 angles
0 dihedrals
0 impropers
3 atom types
1 bond types
1 angle types
0.000000000 117.888000 xlo xhi
0.000000000 119.109700 ylo yhi
0.000000000 300.000000 zlo zhi
Masses
1 15.9994 # O
2 1.00797 # H
3 12.011 # C
Pair Coeffs
1 0.1552976020 3.1655200879
2 0.0000000000 0.0000000000
3 0.0231060600 3.2144799121
Angle Coeffs
1 0.00 109.47
Atoms
#(Atom No. Molecule No. Atom Type. Partial Charge X Y Z)
1 1 3 0 0 0 0 …
5376 1 3 0 67.54 118.4008 0
5377 2 1 -0.8476 83.227380 72.295855 7.40030 …
11376 2001 2 0.4238 65.496380 52.676955 14.57930
Bonds
1 1 5377 5378 …
4000 1 11374 11376
Angles
1 1 5378 5377 5379 …
2000 1 11375 11374 11376
Bond Coeffs
1 0. 1.

Is this a formatting issue? Maybe it’s due to a difference in version (since the paper says the code was done in the 2009 version)? How can I fix this so I can run the files?

Here is my input file for reference:

units real
processors 1 1 1
boundary p p p
neighbor 2.0 bin
atom_style full
#atom_style atomic
pair_style lj/cut/coul/long 14.0
pair_modify mix arithmetic
kspace_style pppm 1.0E-6
bond_style harmonic
angle_style harmonic
read_data lammps_GRA
group water type 1 2
fix 1 water shake 0.000001 500 0 b 1 a 1
velocity water create 300.0 2358 dist gaussian
group graphine type 3
fix 2 graphine setforce 0.0 0.0 0.0
fix 3 water nvt 300.0 300.0 100.
neigh_modify exclude group graphine graphine
timestep 1.0
thermo 1000
restart 200000 sio2.dump
dump 1 all atom 50000 dump.all
dump 2 water atom 1000 dump.water
run 400000

Thank you!

Hello,

This is probably just an issue of bad formatting of the data file: blank lines are needed around the section titles, see this page.

In addition, there may be some additional issues if you are using a LAMMPS script from 2009 with a recent version (btw you should report your LAMMPS version when you post on this forum), but looking at your input, I think that it should work…

Simon

Your data file does not comply with the format as documented in the documentation for the read_data command. The documentation states that certain lines are ignored. In your data file, however, these ignored lines contain content that is later missing and hence you get the errors.

One way to make certain you are writing compliant data files, is to use pre-/post-processing tools that have modules for reading and writing data files.
https://www.lammps.org/prepost.html