Error reading molecule file

Hello everyone,

I’m trying to set up a simulation of butanol using ReaxFF, for which I have included it as a molecule. Upon running my input file, the following error appears:
ERROR: Unknown identifier in data file: Coords (src/read_data.cpp:1151)
Last command: read_data butanol.txt
The identifiers are included as stated in the LAMMPS website, and running the available examples with molecules gives the same error. Is it any kind of bug?
This is my butanol.txt file:

Butanol molecule

15 atoms
14 bonds
25 angles
4 dihedrals

Coords

1 3.169 0.176 0
2 2.367 -0.372 0.012
3 1.243 0.513 -0.011
4 1.271 1.157 -0.905
5 1.253 1.176 0.869
6 -0.029 -0.325 -0.013
7 -0.009 -0.991 0.861
8 -0.023 -0.971 -0.902
9 -1.307 0.523 0.011
10 -1.312 1.202 -0.854
11 -1.301 1.164 0.905
12 -2.585 -0.323 0
13 -2.641 -0.943 -0.903
14 -2.621 -0.995 0.867
15 -3.48 0.309 0.029

Types

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

Charges

1 0.44
2 -0.694
3 0.215
4 -0.006
5 -0.006
6 -0.022
7 0.035
8 0.035
9 0.078
10 -0.004
11 -0.004
12 -0.253
13 0.062
14 0.062
15 0.062

Masses

1 1.008
2 15.9994
3 12.011
4 1.008
5 1.008
6 12.011
7 1.008
8 1.008
9 12.011
10 1.008
11 1.008
12 12.011
13 1.008
14 1.008
15 1.008

Bonds

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

Angles

1 1 1 2 3
2 1 2 3 4
3 1 2 3 5
4 1 2 3 6
5 1 4 3 5
6 1 4 3 6
7 1 5 3 6
8 1 3 6 7
9 1 3 6 8
10 1 3 6 9
11 1 7 6 8
12 1 7 6 9
13 1 8 6 9
14 1 6 9 10
15 1 6 9 11
16 1 6 9 12
17 1 10 9 11
18 1 10 9 12
19 1 11 9 12
20 1 9 12 13
21 1 9 12 14
22 1 9 12 15
23 1 13 12 14
24 1 13 12 15
25 1 14 12 15

Dihedrals

1 1 1 2 3 6
2 1 2 3 6 9
3 1 3 6 9 12
4 1 6 9 12 13

Best regards,
Álvaro

You should have Atoms instead of Coords. Also, Types are wrong. Please look at the docs and you will see your file is quite off.

The file available in the examples, which I copy below, has the same keywords:

dimer granular molecule

5 atoms

Coords

1 0 0 0
2 1 0 0
3 2 0 0
4 2 1 0
5 2 2 0

Types

1 1
2 1
3 1
4 1
5 1

Diameters

1 1.0
2 1.0
3 1.0
4 1.0
5 1.0

Masses

1 0.5
2 0.5
3 0.5
4 0.5
5 0.5

Álvaro

  1. Did you run the example without problems?
  2. Check e.g. examples/reaxff/AB and open data.AB.

No, as I mention, the example gives me the same error, which I thought was weird, given that is the same case I’m trying to replicate. In the example you mention, the whole system is defined in the file, but I want to define a single molecule. The documentation I’m following is this: molecule command — LAMMPS documentation

No, it is a case of serious carelessness when reading and applying the documentation.

a) your molecule file is not correctly following the syntax described there (Masses are per-type and not per-atom).
b) you are using the read_data command — LAMMPS documentation which reads data files that have a similar but not identical format.

To read in a molecule file you have to use the molecule command and then create molecules with the create_atoms command. That way multiple molecules are created, if used properly. The read_data command will read the geometry as is.

Besides that, your molecule file is incorrect for the use with ReaxFF because it has explicit bonds, angles, and dihedrals. In ReaxFF calculations those are, however, implicit (typically used with atom style charge) and thus your input will lead to bogus results if you would adapt it to a data file.

I know I’m clearly misunderstanding something, but running the example corresponding to the implementation of a molecule according to the documentation I’m reading and checking that the program still gives an error in exactly the same part as my code makes me think there could be something wrong.
In this example, molecule is read through the molecule command, but still doesn’t recognize the keyword Coords.

Álvaro

Please provide the exact files (input and molecule file as attachment), the exact command line, and the exact and complete screen output.

This is functionality that has been around a long time, so it is unlikely that something this fundamental is wrong.

Debugging is not so different from research, so complete and precise description of the process and means to reproduce are crucial. Nobody can give good advice on “yes, I did everything according to the documentation”. I have seen too many cases of people saying that and then it turns out they were wrong.

I’m a new user so can’t attach files. The example is the in.pour.2d.molecule, whose input file I attach below:

Pour 2d granular particles into container

dimension 2
atom_style sphere
atom_modify map array
boundary f fm p
newton off
comm_modify vel yes cutoff 2.5

fix prop all property/atom mol ghost yes

region reg block 0 100 0 50 -0.5 0.5 units box
create_box 1 reg

neighbor 0.2 bin
neigh_modify delay 0

IMPORTANT NOTE: these values of stiffness (4000) and timestep (0.001)

are used in this example file to produce a quick simulation and movie.

More appropriate values for realistic simulations would be

k = 4.0e5 and dt = 0.0001, as in bench/in.chute (if it were Hertzian).

pair_style gran/hertz/history 4000.0 NULL 100.0 NULL 0.5 0
pair_coeff * *

timestep 0.001

fix 2 all gravity 1.0 spherical 0.0 -180.0
fix xwalls all wall/gran hertz/history 4000.0 NULL 100.0 NULL 0 1 &
xplane 0 100
fix ywalls all wall/gran hertz/history 4000.0 NULL 100.0 NULL 0 1 &
yplane 0 NULL

molecule object molecule.vshape
fix 3 all rigid/small molecule mol object

insure region size + molecule size does not overlap wall

region slab block 3.0 97.0 30 34.5 -0.5 0.5 units box
fix ins all pour 500 0 4767548 vol 0.8 10 &
region slab mol object rigid 3

fix 4 all enforce2d

compute 1 all erotate/sphere
compute Tsphere all temp/sphere
thermo_style custom step atoms ke c_1 vol
thermo_modify lost ignore norm no temp Tsphere
compute_modify Tsphere dynamic/dof yes

thermo 1000

#dump id all atom 100 tmp.dump

#variable colors string &

"red green blue yellow white &

purple pink orange lime gray"

#variable mol2 atom mol%10
#dump 2 all image 250 image.*.jpg v_mol2 type &

zoom 1.6 adiam 1.5

#dump_modify 2 pad 5 amap 0 10 sa 1 10 ${colors}

#variable colors string &

"red green blue yellow white &

purple pink orange lime gray"

#variable mol3 atom mol%10
#dump 3 all movie 250 movie.mpg v_mol3 type &

zoom 1.6 adiam 1.5

#dump_modify 3 pad 5 amap 0 10 sa 1 10 ${colors}

run 25000

And the molecule.vshape file used is the following:

dimer granular molecule

5 atoms

Coords

1 0 0 0
2 1 0 0
3 2 0 0
4 2 1 0
5 2 2 0

Types

1 1
2 1
3 1
4 1
5 1

Diameters

1 1.0
2 1.0
3 1.0
4 1.0
5 1.0

Masses

1 0.5
2 0.5
3 0.5
4 0.5
5 0.5

Now you can.

This is useless. Without the proper formatting (enclosing in triple backquotes (```) it is messed up but the markdown processing, anyway).
I do have the LAMMPS sources handy and can access them easily including the examples.
That example works without a hitch for me with the current version of LAMMPS.

What is missing is the screen output. That is crucial.