Error : Pair coefficient for hybrid has invalid style

Dear LAMPS users,

I want to use a hybrid pair style to simulate transition metal and a oxide layer interface.
For metal I want to use eam potential and for oxide layer I am not sure which potential would be compatible with metal layer, so decided to use just LJ potential.
I prepared the eam potential for metal combination “ABC” from nist database and it works.
I tried to put charges on oxide atoms, added charge column in the data file and used atom type full but that gave error, so decided to use LJ only for oxide.

I have 5 atom types. I want to use hybrid pair_style but giving error " Pair coefficient for hybrid has invalid style".
Can anyone please tell me what I am doing wrong ?
Also is there a way I can put charges on the oxide atoms ?
Also is there a oxygen potential compatible with eam potential or I have to use LJ only ?

I prepared this script:

Dear LAMPS users,

I want to use a hybrid pair style to simulate transition metal and a oxide
layer interface.
For metal I want to use eam potential and for oxide layer I am not sure
which potential would be compatible with metal layer, so decided to use just
LJ potential.
I prepared the eam potential for metal combination "ABC" from nist database
and it works.
I tried to put charges on oxide atoms, added charge column in the data file
and used atom type full but that gave error, so decided to use LJ only for
oxide.

I have 5 atom types. I want to use hybrid pair_style but giving error " Pair
coefficient for hybrid has invalid style".
Can anyone please tell me what I am doing wrong ?

pair_style hybrid eam/alloy lj/cut 10.0 lj/cut 10.0 lj/cut 10.0 lj/cut
10.0 lj/cut 10.0

pair_coeff 1*3 1*3 ../lammps-31Jul12/potentials/ABC.set A B C

One problem I see is that you forgot to specify the "sub-style" for
atoms 1,2,3. (You left out the "eam/alloy").

So try this instead:

pair_coeff 1*3 1*3 eam/alloy &
../lammps-31Jul12/potentials/ABC.set A B C

(This is a single command. I used the "&" character to split this
command into multiple lines. I was afraid that gmail would split it
in the wrong place.)

If that command does not work, then try something like this:

pair_coeff * * eam/alloy &
../lammps-31Jul12/potentials/ABC.set A B C NULL NULL

I hope this helps.
Andrew
http://lammps.sandia.gov/doc/pair_eam.html

Hello Andrew,

Thanks for the reply.
I tried both, but does not work.

Both gave ERROR: Incorrect args for pair coefficients (pair_eam_alloy.cpp:50)

Any other suggestions ?

Thanks
Mousumi

Sorry to hear it's not working. After looking at the source code, I
think you want to use this syntax:

pair_coeff * * eam/alloy ../lammps-31Jul12/potentials/ABC.set A B C NULL NULL

(Again, the above command should fit on one line, but my email will
probably split it.)

Note that the error message tells you where in the LAMMPS source code
the problem occurred. That is very useful. Open up the file
"pair_eam_alloy.cpp" in the "src" directory. At line 50 it says:

  if (narg != 3 + atom->ntypes)
    error->all(FLERR,"Incorrect args for pair coefficients");

For some reason it thinks you gave it the wrong number of arguments.
Are you sure you have 5 atom types?

  ----- change the code to find out what went wrong -----

One way to figure out what went wrong is to print out the variables
which are causing the problem. Insert the following code right before
line 49:

  for (i==0; i<narg; i++) {
    fprintf(stderr, "!!!!!! arg[%d]=\"%s\"\n", arg[i]);
  }
  fprint(stderr, "!!!!!! atom->ntypes = %d\n", atom->ntypes)

Then recompile LAMMPS, and run LAMMPS again.
What are the last few lines printed before LAMMPS halts?
Cheers

Andrew

I'm sorry, I was lazy and made a mistake. This code should be:

  for (i==0; i<narg; i++) {
    fprintf(stderr, "!!!!!! arg[%d]=\"%s\"\n", i, arg[i]);
  }
  fprintf(stderr, "!!!!!! atom->ntypes = %d\n", atom->ntypes);

Add it before line 49 of pair_eam_alloy.cpp:

  if (narg != 3 + atom->ntypes)
    error->all(FLERR,"Incorrect args for pair coefficients");

Andrew