Err: Numeric index is out of bonds

Dear Lammps users,
I want to add harmonic bonds in the simulation box, but there is error after bond_coeff ’ Numeric index is out of bonds’. How can I fix it? Does it relate to the parameters? Thank you so much!

Below is my log.lammps

units metal

dimension 3

boundary s s p

atom_style atomic

atom_style bond

lattice diamond 3.57

Lattice spacing in x,y,z = 3.57 3.57 3.57

region whole block 0 5 0 6 0 6

create_box 1 whole

Created orthogonal box = (0 0 0) to (17.85 21.42 21.42)

2 by 4 by 2 MPI processor grid

create_atoms 1 region whole

Created 1578 atoms

mass 1 1.0

pair_style sw

pair_coeff * * Si.sw Si

bond_style harmonic

bond_coeff 2 0.2 0.117

ERROR: Numeric index is out of bounds (…/force.cpp:753)

Thank you so much!

Hao

Dear Lammps users,
I want to add harmonic bonds in the simulation box, but there is error after
bond_coeff ' Numeric index is out of bonds'. How can I fix it? Does it
relate to the parameters? Thank you so much!

you define a bond parameter, but LAMMPS doesn't know that you want to
have bonds.
you have to use a data file or reserve space for bonds and bond types
when you use the create_box command.
please (re-)read the documentation for details.

You need a data file which lists the pairs of atoms

that are bonded in a Bonds section. And that file

will also list the allowed number of bond types at the top.

The default is 0 which is why you are getting the error.

You should also probably not be using harmonic bonds with

a 3-body potential like SW.

Steve