Hello everyone
I got this below error
ERROR: Numeric index 1 is out of bounds (1-0) (src/MOLECULE/bond_harmonic.cpp:128)
Last command: bond_coeff 1 8.0 1.2
Please anybody can help
and this my input script

1st trial


------------------------ INITIALIZATION ----------------------------

units metal
dimension 3
boundary p p p
atom_style angle
lattice fcc 3.52

----------------------- ATOM DEFINITION ----------------------------`

region 1task block 0 10 0 10 0 10
create_box 2 1task
create_atoms 2 region 1task

neighbor 2 bin

------------------------ FORCE FIELDS ------------------------------

pair_style lj/cut 2.5
pair_coeff 1 2 1.0 1.0 2.5

bond_style harmonic
bond_coeff 5 80.0 1.2
dihedral_style harmonic

------------------------ Equilibration Run --------------------------

fix 1 all nve
timestep 0.001
reset_timestep 0

thermo 50
thermo_style custom step etotal pe ke temp press epair

------------------------ Dynamic Run -------------------------------

dump 1 all atom 100 dump
run 3000

First off, if you want help with using LAMMPS you need to post to one of the LAMMPS categories. I saw your post only by accident and then recategorized it.

Second, your problem happens because you didn’t reserve space for having bond types when you created your simulation box. This is how LAMMPS works, when you create the simulation box certain properties (like atom style) and internal array sizes are locked and cannot be changed unless you restart LAMMPS. This is explained in the documentation for the create_box command — LAMMPS documentation

Besides, your input only creates atoms but no bonds, so there is no point in defining a bond style and bond coeffs. Similarly, you use atom style angle, which does not support dihedrals, yet your input defines a dihedral style. These are all problems causing LAMMPS to abort for reasons that are explained in the manual. Futhermore, this looks like you were using cut-n-paste to put different pieces of input together. The bond parameters (and using a bond type 5!!) look very unreasonable for reduced units. Similarly the neighbor list skin.

You will continue to run into all kinds of (unexpected) problems if you don’t build your inputs in a more sane way by starting with an empty file and then add individual lines after reading the corresponding documentation carefully so you know well what that does and then run to see if that produces the expected result and then add the next line and so on.

Hello, can LAMMPS specify the number of bondtyper in the script file instead of the data file?

Please follow the forum and mailing list etiquette that new questions (and this one is not really an answer to the original post) are posted as a new question with a suitable topic. It will make it easier for people that come later to find the answer and increases your chances to get a response sooner.

Yes, you can reserve space for extra bond types with the read_data and create_box commands. For details please study the corresponding pages in the manual.


Thanks for your reply. The problem has been solved.