Problem with hybrid/overlay

Dear All users

I am using this pair style hybrid/overlay for my system.

My system includes clacite crystal and water molecules so that I want to use lj/cut and coul/long

and buck potentials for interactions between molecules,

Water molecules : lj/cut + coul/long

calacite : buck + lj/cut

Interaction between water molecules and calcite surface : buck

I defined all of the parameters for all pairs:

pair_style hybrid/overlay lj/cut 10 coul/long 10 buck 10
pair_coeff 1 1 lj/cut 0.0069373284 3.033 9.5
pair_coeff 1 1 coul/long
pair_coeff 2 2 lj/cut 1.1796314979 0.899 10
pair_coeff 2 2 buck 859.628302608 0.4549590537 577.14252747 10
pair_coeff 2 1 buck 608.87742608 0.342567726 456.17353273 10
.
.
.

But I got this error:

Dear All users

I am using this pair style hybrid/overlay for my system.

My system includes clacite crystal and water molecules so that I want to use
lj/cut and coul/long

and buck potentials for interactions between molecules,

Water molecules : lj/cut + coul/long

calacite : buck + lj/cut

Interaction between water molecules and calcite surface : buck

I defined all of the parameters for all pairs:

    pair_style hybrid/overlay lj/cut 10 coul/long 10 buck 10
   pair_coeff 1 1 lj/cut 0.0069373284 3.033
9.5
    pair_coeff 1 1 coul/long
    pair_coeff 2 2 lj/cut 1.1796314979 0.899
10
    pair_coeff 2 2 buck 859.628302608 0.4549590537
577.14252747 10
    pair_coeff 2 1 buck 608.87742608 0.342567726
456.17353273 10
.
.
.

But I got this error:
-------------------
  31392 angles
  36000 dihedrals
Finding 1-2 1-3 1-4 neighbors ...
  4 = max # of 1-2 neighbors
  6 = max # of 1-3 neighbors
  12 = max # of 1-4 neighbors
  16 = max # of special neighbors
ERROR: Incorrect args for pair coefficients (../pair_buck.cpp:212)
---------------------

I don't know, Where does this error come from?

it is in the documentation:

http://lammps.sandia.gov/doc/pair_coeff.html

look closer!

axel.

pair_coeff 2 2 buck 859.628302608 0.4549590537 577.14252747 10
pair_coeff 2 1 buck 608.87742608 0.342567726 456.17353273 10
But I got this error:
ERROR: Incorrect args for pair coefficients (../pair_buck.cpp:212)
---------------------

I don't know, Where does this error come from?

1)
The name of the file "pair_buck.cpp" tells you which pair style has
the problem. It seems like LAMMPS does not like one of these lines:

pair_coeff 2 2 buck 859.628302608 0.4549590537 577.14252747 10
pair_coeff 2 1 buck 608.87742608 0.342567726 456.17353273 10

2) Check your "log.lammps" file.
Did LAMMPS stop when it encountered one of these two lines? If so, which one?

Incidentally, there are some examples for how to use the "pair_coeff"
command for the "buck" pair style here:
http://lammps.sandia.gov/doc/pair_buck.html
(However I don't think this is your problem...)

3) Here is the problem:
pair_coeff 2 1 buck 608.87742608 0.342567726 456.17353273 10

I think LAMMPS pair commands fail unless the second atom type is as
large as the first. So, in your case change "2 1" to "1 2". In other
words, use:

pair_coeff 1 2 buck 608.87742608 0.342567726 456.17353273 10

3) For future reference, it is always helpful to open the file
mentioned in the error message.

In your case, open the "pair_buck.cpp" file (in the "src" directory)
using a text editor, and go to line 212.

  int count = 0;
  for (int i = ilo; i <= ihi; i++) {
    for (int j = MAX(jlo,i); j <= jhi; j++) {
      a[i][j] = a_one;
      rho[i][j] = rho_one;
      c[i][j] = c_one;
      cut[i][j] = cut_one;
      setflag[i][j] = 1;
      count++;
    }
  }

  if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");

So the problem has to do with the boundaries (ilo, ihi, jlo, jhi).
Again, this makes me think the problem is because you use "2 1"
instead of "1 2".

So try the suggestion above (using "1 2" instead of "2 1") and see if
that fixes the problem.

it is in the documentation:
http://lammps.sandia.gov/doc/pair_coeff.html

look closer!
axel

Axel is right, the documentation does say:

"Note that only type pairs with I <= J are considered"

But I admit, this is a pet peeve of mine. I think the I<=J
requirement causes unnecessary confusion to new users. (I've been
hoping Steve would change this policy.)

Cheers

Andrew

Dear Andrew

Thank you very much, exactly!

I study source code and manual but I don’t think my problem comes from I>j,

Thank you again,

Dear Andrew

Thank you very much, exactly!

I study source code and manual but I didn’t(!) think my problem comes from I>j,

Thank you again,

Yes it does.