Problem with creating a molecule using the create_atoms command

Dear lammps users,

I have only recently started to familiarize myself with lammps. I have written a molecule file for a medium chain alkane (decane). I would now like to insert this molecule into a lammps simulation using the create_atoms command.

Here you can find my input file and my molecule file:
Input file:

input file dacane simulation

units real
dimension 3
molecule decane decane_mol.txt
atom_style template decane
processors * * *
boundary p p p

set up styles

pair_style lj/cut 8.75
bond_style harmonic
angle_style harmonic
dihedral_style multi/harmonic

set up simulation box

region 1 block -20 20 -20 20 -20 20
create_box 1 1 bond/types 2 angle/types 3 dihedral/types 1

create atoms

create_atoms 0 single 0 0 0 mol decane 1234

set up coefficients

mass 1 12.011
mass 2 1.008

pair_coeff 1 1 0.066 3.5 8.75
pair_coeff 2 2 0.03 2.5 6.25

bond_coeff 1 200.0 1.54
bond_coeff 2 125.0 0.99

angle_coeff 1 57.5 109.5
angle_coeff 2 25.0 109.5
angle_coeff 3 40.0 109.5

dihedral_coeff 1 2.2 2.9 -3.1 6.3 7.5

outputs

thermo 100
thermo_style custom step temp pe press vol lx density
dump 2 all custom 1000 md.decanetrj id type x y z

initial minimization

minimize 1.0e-10 1.0e-10 100000 100000

relaxation

fix 1 all nvt temp 100 500 10
run 100000
unfix 1

write_data decane_10_result.dat
write_restart decane_10_restart.rest

Molecule file:

alkane data file

header section:

32 atoms
31 bonds
60 angles
7 dihedrals

body section:

Coords

1 0 0 0
2 1.500 0 0.348
3 3 0 0
4 4.501 0 0.348
5 6.001 0 0
6 7.501 0 0.348
7 9.001 0 0
8 10.501 0 0.348
9 12.002 0 0
10 13.502 0 0.348
11 -0.964 0 0.224
12 0 0.964 -0.224
13 0 -0.964 -0.224
14 1.500 0.964 0.572
15 1.500 -0.964 0.572
16 3 0.964 -0.224
17 3 -0.964 -0.224
18 4.501 0.964 0.572
19 4.501 -0.964 0.572
20 6.001 0.964 -0.224
21 6.001 -0.964 -0.224
22 7.501 0.964 0.572
23 7.501 -0.964 0.572
24 9.001 0.964 -0.224
25 9.001 -0.964 -0.224
26 10.501 0.964 0.572
27 10.501 -0.964 0.572
28 12.002 0.964 -0.224
29 12.002 -0.964 -0.224
30 13.502 0.964 0.572
31 13.502 -0.964 0.572
32 14.466 0 0.124

Types

1 1
2 1
3 1
4 1
5 1
6 1
7 1
8 1
9 1
10 1
11 2
12 2
13 2
14 2
15 2
16 2
17 2
18 2
19 2
20 2
21 2
22 2
23 2
24 2
25 2
26 2
27 2
28 2
29 2
30 2
31 2
32 2

Bonds

1 1 1 2
2 1 2 3
3 1 3 4
4 1 4 5
5 1 5 6
6 1 6 7
7 1 7 8
8 1 8 9
9 1 9 10
10 2 1 11
11 2 1 12
12 2 1 13
13 2 2 14
14 2 2 15
15 2 3 16
16 2 3 17
17 2 4 18
18 2 4 19
19 2 5 20
20 2 5 21
21 2 6 22
22 2 6 23
23 2 7 24
24 2 7 25
25 2 8 26
26 2 8 27
27 2 9 28
28 2 9 29
29 2 10 30
30 2 10 31
31 2 10 32

Angles

1 1 1 2 3
2 1 2 3 4
3 1 3 4 5
4 1 4 5 6
5 1 5 6 7
6 1 6 7 8
7 1 7 8 9
8 1 8 9 10
9 2 11 1 12
10 2 11 1 13
11 2 12 1 13
12 2 14 2 15
13 2 16 3 17
14 2 18 4 19
15 2 20 5 21
16 2 22 6 23
17 2 24 7 25
18 2 26 8 27
19 2 28 9 29
20 2 30 10 31
21 2 30 10 32
22 2 31 10 32
23 3 1 2 14
24 3 1 2 15
25 3 3 2 14
26 3 3 2 15
27 3 2 3 16
28 3 2 3 17
29 3 4 3 16
30 3 4 3 17
31 3 3 4 18
32 3 3 4 19
33 3 5 4 18
34 3 5 4 19
35 3 4 5 20
36 3 4 5 21
37 3 6 5 20
38 3 6 5 21
39 3 5 6 22
40 3 5 6 23
41 3 7 6 22
42 3 7 6 23
43 3 6 7 24
44 3 6 7 25
45 3 8 7 24
46 3 8 7 25
47 3 7 8 26
48 3 7 8 27
49 3 9 8 26
50 3 9 8 27
51 3 8 9 28
52 3 8 9 29
53 3 10 9 28
54 3 10 9 29
55 3 11 1 2
56 3 12 1 2
57 3 13 1 2
58 3 30 10 9
59 3 31 10 9
60 3 32 10 9

Dihedrals

1 1 1 2 3 4
2 1 2 3 4 5
3 1 3 4 5 6
4 1 4 5 6 7
5 1 5 6 7 8
6 1 6 7 8 9
7 1 7 8 9 10

Special Bond Counts

1 4 3 3
2 4 6 3
3 4 6 6
4 4 6 6
5 4 6 6
6 4 6 6
7 4 6 6
8 4 6 6
9 4 6 3
10 4 3 3
11 1 3 3
12 1 3 3
13 1 3 3
14 1 3 6
15 1 3 6
16 1 3 6
17 1 3 6
18 1 3 6
19 1 3 6
20 1 3 6
21 1 3 6
22 1 3 6
23 1 3 6
24 1 3 6
25 1 3 6
26 1 3 6
27 1 3 6
28 1 3 6
29 1 3 6
30 1 3 3
31 1 3 3
32 1 3 3

Special Bonds

1 2 11 12 13 3 14 15 4 16 17
2 1 3 14 15 4 11 12 13 16 17 5 18 19
3 2 4 16 17 1 6 14 15 18 19 6 11 12 13 20 21
4 3 5 18 19 2 6 16 17 20 21 1 7 14 15 22 23
5 4 6 20 21 3 7 18 19 22 23 2 8 16 17 24 25
6 5 7 22 23 4 8 20 21 24 25 3 9 18 19 26 27
7 6 8 24 25 5 9 22 23 26 27 4 10 20 21 28 29
8 7 9 26 27 6 10 24 25 28 29 5 22 23 30 31 32
9 8 10 28 29 7 26 27 30 31 32 6 24 25
10 9 30 31 32 8 28 29 7 26 27
11 1 2 12 13 3 14 15
12 1 2 11 13 3 14 15
13 1 2 11 12 3 14 15
14 2 1 3 15 4 11 12 13 16 17
15 2 1 3 14 4 11 12 13 16 17
16 3 2 4 17 1 5 14 15 18 19
17 3 2 4 16 1 5 14 15 18 19
18 4 3 5 19 2 6 16 17 20 21
19 4 3 5 18 2 6 16 17 20 21
20 5 4 6 21 3 7 18 19 22 23
21 5 4 6 20 3 7 18 19 22 23
22 6 5 7 23 4 8 20 21 24 25
23 6 5 7 22 4 8 20 21 24 25
24 7 6 8 25 5 9 22 23 26 27
25 7 6 8 24 5 9 22 23 26 27
26 8 7 9 27 6 10 24 25 28 29
27 8 7 9 26 6 10 24 25 28 29
28 9 8 10 29 7 26 27 30 31 32
29 9 8 10 28 7 26 27 30 31 32
30 10 9 31 32 8 28 29
31 10 9 30 32 8 28 29
32 10 9 30 31 8 28 29

When I run the input file with lammps, I get the following error message:

ERROR: Invalid atom type in create_atoms mol command (src/create_atoms.cpp:300)
Last command: create_atoms 0 single 0 0 0 mol decane 1234

I unfortunately don’t understand right now what the problem is. I would therefore be very grateful for any tips and hints.

Many thanks and best regards

Please see the guidelines post for how to correctly quote input and other text files in the forum.

Your create_box command reserves space for just one (1!) atom type, but your decane molecule file has two (2!) atom types to the atoms with atom type 2 have an “invalid type”.

Thank you very much for the quick reply. Now it worked out fine.
Sorry for the incorrectly specified files, I’ll take a closer look at the guidelines next time.