[lammps-users] About "incorrect args for bond coeff"

Here is my script

units lj
dimension 3
boundary p p p

atom_style hybrid bond granular
lattice diamond 1
neighbor 0.3 bin
neigh_modify delay 5

region box cylinder x 0 0 7 0 20 side in units lattice
create_box 2 box

define groups

region 1 cylinder x 0 0 6.8 0.2 19.8 side out units lattice
region 2 cylinder x 0 0 6.0 0.0 20.0 side out units lattice
region 3 cylinder x 0 0 6.2 0.0 20.0 side in units lattice
region 4 cylinder x 0 0 6.0 0.0 20.0 side in units lattice
create_atoms 1 region 2
create_atoms 1 random 1000 12481 4
group box region box
group 1 region 1
group 2 region 2
group 3 region 3
group 4 region 4
group 5 intersect box 1
group 6 intersect 2 3

#group 8 for freeze
#group 10 for bond
#group 9 for membrane
#group 4 for flow

group 7 union 5 6
group 8 subtract 7 4
group 9 intersect box 2
group 10 subtract 9 8
#group 11 subtract all 9

LJ potentials

pair_style lj/cut 1.12246
pair_coeff * * 1.0 1.0 1.12246
pair_coeff 1 2 6.0 1.0 1.12246

#here is the problem, as I add “#” to ignore bond style and coeff command, it run normally.
bond_style harmonic
bond_coeff 1 30.0 1.0

set group 9 type 1
set group 4 type 2

mass 1 1.0
mass 2 1.0

fix 1 all nve

velocity 8 set 0.0 0.0 0.0

fix 2 8 freeze

Run

timestep 0.0001
thermo 10

thermo_modify lost ignore

run 1000

#here is the problem, as I add "#" to ignore bond style and coeff command,
it run normally.
bond_style harmonic
bond_coeff 1 30.0 1.0

you have not defined any bond types and bonds
and not even told lammps that those exist. thus
lammps assumes that you have no bonds at all
and gives you an error message.

you need to use a data file.

axel.