ERROR: Numeric index is out of bounds (src/pair_hybrid.cpp:425) in tersoff

While using tersoff potential in hybrid pair style. I used the pair coeff command as given below

pair_coeff * *tersoff SiO.tersoff O Si

while running I am getting an error
ERROR: Numeric index is out of bounds (src/pair_hybrid.cpp:425)
Last command: pair_coeff * *tersoff SiO.tersoff O Si.

why does it comes, because the is no numerical values in the syntax of tthe tersoff potential.

Please always report which version of LAMMPS you are using when reporting unexpected behavior or errors.

You have a syntax error here. There needs to be a blank between the second ‘*’ and ‘tersoff’. Since a similar syntax (e.g. *2) is used to indicate ranges of atom types, the code will jump into the function computing such ranges. In that function “tersoff” converts to 0 and ‘*0’ would be an invalid range since types have to be > 0. Hence the error. The confusing error message can only happen with an old version of LAMMPS, though. If you would use a current version f LAMMPS the error message would be more meaningful:

ERROR: Invalid range string: *tersoff (src/pair_hybrid.cpp:477)
Last command: pair_coeff * *tersoff SiO.tersoff )
1 Like

Thank you for your comment. I am using LAMMPS (20 Nov 2019)

I gave a blank between * and tersoff. the error change now I got an error
ERROR: Incorrect args for pair coefficients (src/MANYBODY/pair_tersoff.cpp:300)
Last command: pair_coeff * * tersoff SiO.tersoff O Si

how to solve it.

You should upgrade your LAMMPS version. You are currently missing over 3 years worth of bug fixes, new features, and improvements.

Impossible to say for certain without knowing the rest of your input. This error usually means that your pair_coeff command line does not have the required number of arguments. With pair style tersoff, there must be as many element entries as you have atom types. My guess is that you are missing something.

This also is likely an indication that you are trying to simulate a hybrid system with tersoff representing SiO2, possibly a slab with a surface. That is not likely to give meaningful results, since the parameterization in the SiO.tersoff file is only suitable for bulk systems.

I have attached the input file
#====================== Box and units (use real units and periodic boundaries)
units real
boundary p p p

===================== basic parameters

atom_style full
atom_modify map array
bond_style harmonic
angle_style harmonic
dihedral_style opls
pair_style hybrid lj/cut/coul/cut 8.5 10 tersoff

#================Simulation_box

read_data data.acetone
read_data data.sio2 shift 0 0 20 add append
pair_coeff * * tersoff SiO.tersoff O Si

============= give atoms velocity, apply fix nvt (fixed volume)

============= choose timestep (0.1 fs)

fix mynvt all nvt temp 298.15 298.15 0.1
timestep 0.1

============= dump atom positions every 0.5 ps and log info every 0.5 ps

#dump dp1 all atom 1000 dump_silica_acetone.lammpstrj
thermo 1000

============= run (2 ps)

run 200000

As you said, I am trying to simulate a hybrid system with tersoff representing SiO2, for solid-liquid interface. I need to equilibrate a liquid on the sio2 surface for studying wetting properties by measuring the contact angle. can you suggest a way or hint how to do it.

Which has no information about atom types, so it is useless.

Then I have to repeat, that the parameters in SiO.tersoff are not suitable for it, you need to find a different force field to represent the surface. You are not the first person to do so. Also, please keep in mind that an SiO2 surface is a polar surface and usually dangling Oxygen valences are saturated with hydrogen, i.e. those have terminating OH groups.

There is a large body of research from people studying SiO2 or similar surfaces. You need to evaluate publications studying systems similar to yours and check what they used.

1 Like