pair_coeff in 3 layers and more

Hello lammps users,

I am studying stacking in graphite and got trouble in definition of pair_coeff.

I used these commands for 3 layers:
pair_style hybrid tersoff tersoff tersoff lj/cut 3.5 lj/cut 3.5
read_data structure.dat
pair_coeff 1 2 lj/cut 0.00284 3.4 2.5
pair_coeff 2 3 lj/cut 0.00284 3.4 2.5
pair_coeff * * tersoff 1 BNC.tersoff C NULL NULL
pair_coeff * * tersoff 2 BNC.tersoff NULL C NULL
pair_coeff * * tersoff 3 BNC.tersoff NULL NULL C

and got this error:
pair_style hybrid tersoff tersoff tersoff lj/cut 3.5 lj/cut 3.5

read_data structure.dat
Reading data file …
orthogonal box = (0 0 0) to (81.7132 85.35 28.24)
2 by 2 by 1 MPI processor grid
reading atoms …
4500 atoms

pair_coeff 1 2 lj/cut 0.00284 3.4 2.5
ERROR: Expected integer parameter in input script or data file (…/pair_hybrid.cpp:343)

which means the pair_coeff is not correct. However, for 2 layers I used the commands as below and I had no problem:

pair_style hybrid tersoff tersoff lj/cut 3.5
read_data structure.dat
pair_coeff 1 2 lj/cut 0.00284 3.4 2.5
pair_coeff * * tersoff 1 BNC.tersoff C NULL
pair_coeff * * tersoff 2 BNC.tersoff NULL C

Does anyone see any problem in extension from 2 layers to 3 layers?

Best regards,

Nima Pirouzmand

Hello lammps users,
I am studying stacking in graphite and got trouble in definition of
pair_coeff.
I used these commands for 3 layers:
pair_style hybrid tersoff tersoff tersoff lj/cut 3.5 lj/cut
3.5
read_data structure.dat
pair_coeff 1 2 lj/cut 0.00284 3.4 2.5
pair_coeff 2 3 lj/cut 0.00284 3.4 2.5
pair_coeff * * tersoff 1 BNC.tersoff C NULL NULL
pair_coeff * * tersoff 2 BNC.tersoff NULL C NULL
pair_coeff * * tersoff 3 BNC.tersoff NULL NULL C

and got this error:
pair_style hybrid tersoff tersoff tersoff lj/cut 3.5 lj/cut
3.5

read_data structure.dat
Reading data file ...
  orthogonal box = (0 0 0) to (81.7132 85.35 28.24)
  2 by 2 by 1 MPI processor grid
  reading atoms ...
  4500 atoms

pair_coeff 1 2 lj/cut 0.00284 3.4 2.5
ERROR: Expected integer parameter in input script or data file
(../pair_hybrid.cpp:343)

which means the pair_coeff is not correct. However, for 2 layers I used
the commands as below and I had no problem:

pair_style hybrid tersoff tersoff lj/cut 3.5
read_data structure.dat
pair_coeff 1 2 lj/cut 0.00284 3.4 2.5
pair_coeff * * tersoff 1 BNC.tersoff C NULL
pair_coeff * * tersoff 2 BNC.tersoff NULL C

Does anyone see any problem in extension from 2 layers to 3 layers?

​yes. if you specify a substyle multiple times, you have to flag them with
indices. you did this for tersoff.
however, in your case, there is not need at all to specify lj/cut as
sub-style multiple times​.

​axel.​