[lammps-users] override a previous pair_coeff with hybrid/overlay

Dear all,

It seems that the pair_coeff command cannot override a previous
setting for the same I,J pair when using pair_style hybrid/overlay.
For instance, using the following set of commands (with the 13 Jun
2010 version):

pair_style hybrid/overlay lj/smooth 7.0 9.0 coul/long 7.0
pair_coeff * * lj/smooth 0.1 3.0
pair_coeff 8 8 lj/smooth 0.1554 3.166
pair_coeff 6 8 lj/smooth 0.1015 3.367
pair_coeff * * coul/long
kspace_style pppm 1.e-4

I get the following error:

"ERROR: Incorrect args for pair coefficients" at the line: "pair_coeff
8 8 lj/smooth 0.1554 3.166"

The problem is solved with the following input:

pair_style hybrid/overlay lj/smooth 7.0 9.0 coul/long 7.0
pair_coeff *5 * lj/smooth 0.1 3.0
pair_coeff 6 6*7 lj/smooth 0.1 3.0
pair_coeff 7 7 lj/smooth 0.1 3.0
pair_coeff 8 8 lj/smooth 0.1554 3.166
pair_coeff 6 8 lj/smooth 0.1015 3.367
pair_coeff * * coul/long
kspace_style pppm 1.e-4

Is this issue indeed related to the impossibility to override
pair_coeff with pair_style hybrid/overlay? In this case, is it
possible to remove this limit?

Best regards,
Laurent

Dear all,

It seems that the pair_coeff command cannot override a previous
setting for the same I,J pair when using pair_style hybrid/overlay.

of course. this is would be undefined behavior.

how should the overlay pair style be able to tell if
you want to override a previous setting or if you
want to add to it?

it is cleaner to not allow any of that to happen.

cheers,
    axel.

Is this issue indeed related to the impossibility to override
pair_coeff with pair_style hybrid/overlay? In this case, is it
possible to remove this limit?

This is the difference between hybrid and hybrid/overlay.
As Axel indicates, you can't expect overlay to both replace
and sum two potentials specified for the same pair of
atom types.

Steve

Dear Steve and Axel,

I understand, but since pair_coeff are specified for one given
substyle, I'm not sure I get why it would be a problem to be able to
override pair_coeff for a given substyle...

Best,
Laurent

Dear Steve and Axel,

I understand, but since pair_coeff are specified for one given
substyle, I'm not sure I get why it would be a problem to be able to
override pair_coeff for a given substyle...

...and the next person will not understand why
you cannot add the same type potential with
two different parameter sets to one pair of atom types.

it _is_ an undefined behavior. you would need a
flag that tells the overlay style whether you want to
add or to replace and when you allow replace the
question is which one if you have multiples added
on top of each other.

cheers,
    axel.

Now I see what you mean. I removed the restriction - see the 19Jun10 patch.
These 2 sets of commands now do the same thing, and the 2nd set is
allowed (before it would give the error you indicated):

pair_style lj/cut 2.5
pair_coeff * * 1.0 1.0
pair_coeff 2 2 1.5 0.8

pair_style hybrid/overlay lj/cut 2.5
pair_coeff * * lj/cut 1.0 1.0
pair_coeff 2 2 lj/cut 1.5 0.8

Steve