hybrid/overlay

Dear lammps users,

The doc page for pair hybrid/overlay says this:
“you do not have to specify a pair_coeff command for I,J since the I,J type pair will be assigned automatically to the I,I sub-style and its coefficients generated by the mixing rule used by that sub-style. For the hybrid/overlay style, there is an additional requirement that both the I,I and J,J pairs are assigned to a single sub-style”

Unless I misunderstand, it means that if I have 2 sub-styles for both I,I and J,J then no mixing rules should be applied if I don’t provide a pair_coef command for I,J in one of the sub-styles.
Yet, I use two sub-styles for both I,I and I,J and there’s a difference in the energy values in my simulation when

  1. I don’t write a pair_coef command for I,J interaction with Lennard Jones sub-style.
  2. I use pair_coef to specify epsilon=0.0 for I,J interaction with Lennard Jones sub-style.

Does anyone know where the difference in energy values comes from? The 2 simulation setups are otherwise identical.

Regards.

Dear lammps users,

The doc page for pair hybrid/overlay says this:
"you do not have to specify a pair_coeff command for I,J since the I,J type
pair will be assigned automatically to the I,I sub-style and its
coefficients generated by the mixing rule used by that sub-style. For the
hybrid/overlay style, there is an additional requirement that both the I,I
and J,J pairs are assigned to a single sub-style"

Unless I misunderstand, it means that if I have 2 sub-styles for both I,I
and J,J then no mixing rules should be applied if I don't provide a
pair_coef command for I,J in one of the sub-styles.
Yet, I use two sub-styles for both I,I and I,J and there's a difference in
the energy values in my simulation when
    1) I don't write a pair_coef command for I,J interaction with Lennard
Jones sub-style.
    2) I use pair_coef to specify epsilon=0.0 for I,J interaction with
Lennard Jones sub-style.

Does anyone know where the difference in energy values comes from? The 2
simulation setups are otherwise identical.

impossible to say without a specific example. most likely there is
something happening, that breaks the requirements.
my personal recommendation is to never depend on mixing, but always
supply explicit coefficients. then there are no questions. hybrid
overlay can be particularly subtle.

axel.

I don’t understand how you do (1), i.e. not assign a pair coeff to I,J.

If you add these commands to bench/in.lj (modified for 2 types), it will run if either of

the 1/2 coeffs is included. If both are commented out, you get

an error that nothing has been assigned to 1/2. Which is correct,

b/c no auto-mixing was done b/c the 1/1 and 2/2 potentials are different.

pair_style hybrid/overlay lj/cut 2.5 buck 2.5
pair_coeff 1 1 lj/cut 1.0 1.0 2.5
#pair_coeff 1 2 lj/cut 1.0 1.0 2.5
#pair_coeff 1 2 buck 1.0 1.0 2.5
pair_coeff 2 2 buck 1.0 1.0 2.5

Conversely, if you do this:

pair_style hybrid/overlay lj/cut 2.5 #buck 2.5
pair_coeff 1 1 lj/cut 1.0 1.0 2.5
#pair_coeff 1 2 lj/cut 1.0 1.0 2.5
#pair_coeff 1 2 buck 1.0 1.0 2.5
pair_coeff 2 2 lj/cut 1.0 1.0 2.5

then it runs w/out specifiying 1/2, because mixing can be done.

Steve

Steve, Axel thank you for your replies.

Steve, in your example you have only one sub style for each type pair. I’m referring to a case where two sub styles are defined for each type pair.
In your example it would be something like:
pair_style hybrid/overlay lj/cut 2.5 buck 2.5
pair_coeff 1 1 lj/cut 1.0 1.0 2.5
pair_coeff 2 2 lj/cut 1.0 1.0 2.5
#pair_coeff 1 2 lj/cut manual_mixing_value manual_mixing_value
pair_coeff 1 2 buck 1.0 1.0 2.5
pair_coeff 1 1 buck 1.0 1.0 2.5
pair_coeff 2 2 buck 1.0 1.0 2.5

If I understand correctly, the part of the doc page I quoted says that in this case no automatic mixing rules are applied for the 1 2 lj/cut interaction.
But I get 3 different behaviors when:

  1. Commented out : #pair_coeff 1 2 lj/cut manual_mixing_value manual_mixing_value
  2. Not commented : pair_coeff 1 2 lj/cut manual_mixing_value manual_mixing_value
  3. pair_coeff 1 2 lj/cut 0.0 0.0

First and third cases give the same results except for the system’s potentiel energy value after relaxation.
The second case gives totally different results. I’m quite confused…

Regards.
Jonathan

Steve, Axel thank you for your replies.

Steve, in your example you have only one sub style for each type pair. I'm
referring to a case where two sub styles are defined for each type pair.
In your example it would be something like:
pair_style hybrid/overlay lj/cut 2.5 buck 2.5
pair_coeff 1 1 lj/cut 1.0 1.0 2.5
pair_coeff 2 2 lj/cut 1.0 1.0 2.5
#pair_coeff 1 2 lj/cut manual_mixing_value manual_mixing_value
pair_coeff 1 2 buck 1.0 1.0 2.5
pair_coeff 1 1 buck 1.0 1.0 2.5
pair_coeff 2 2 buck 1.0 1.0 2.5

If I understand correctly, the part of the doc page I quoted says that in
this case no automatic mixing rules are applied for the 1 2 lj/cut
interaction.
But I get 3 different behaviors when:
    1) Commented out : #pair_coeff 1 2 lj/cut manual_mixing_value
manual_mixing_value
    2) Not commented : pair_coeff 1 2 lj/cut manual_mixing_value
manual_mixing_value
    3) pair_coeff 1 2 lj/cut 0.0 0.0

First and third cases give the same results except for the system's
potentiel energy value after relaxation.
The second case gives totally different results. I'm quite confused...

like i mentioned before, please provide *complete* inputs that show
the different behaviors otherwise it is very difficult to discuss.
your case 2 has obviously the expected behavior. there cannot be
mixing when it is ambiguous. please also note that there is a
different behavior for hybrid/overlay and hybrid. for hybrid overlay,
there *should* only be mixing applied to generate 1 2 interactions if
there is no pair_coeff statement for 1 2. but it also requires that
all potentials for 1 1 and 2 2 do support mixing (and buck does not).

axel.

I attached an input script which shows the 3 behaviors I mentioned. It's a dummy example with no physics in it. Please run it first as is then with either of the 1-2 lj pair_coeffs commented out in turn. Look at the total energy of the system at step 0. When I do that I get 3 different values. Input script:

variable x index 1
variable y index 1
variable z index 1

variable xx equal 8*$x
variable yy equal 8*$y
variable zz equal 8*z variable zz3 equal 3\*{zz}/10.0
variable zz4 equal 4.0*\{zz\}/10\.0 variable zz5 equal 5\.0\*{zz}/10.0
variable zz6 equal 6.0*${zz}/10.0

units lj
atom_style full

lattice fcc 0.8442
region box block 0 \{xx\} 0 {yy} 0 \{zz\} create\_box 2 box region lower block 0 {xx} 0 \{yy\} {zz3} \{zz4\} create\_atoms 1 region lower region upper block 0 {xx} 0 \{yy\} {zz5} ${zz6}
create_atoms 2 region upper

mass 1 1.0
mass 2 1.0

set type 1 charge 0.3
set type 2 charge -0.2

velocity all create 1.44 87287 loop geom

pair_style hybrid/overlay lj/cut/coul/cut 2.5 buck 2.5
pair_coeff 1 1 lj/cut/coul/cut 1.2 1.0
pair_coeff 2 2 lj/cut/coul/cut 1.0 1.0
#pair_coeff 1 2 lj/cut/coul/cut 0.0 0.0

variable mix1 equal sqrt(1.2*1.0)
print "mix1 = \{mix1\}" \#pair\_coeff 1 2 lj/cut/coul/cut {mix1} 1.0

pair_coeff 1 2 buck 1.1 1.1 1.1
pair_coeff 1 1 buck 1.0 1.0 1.0
pair_coeff 2 2 buck 1.2 1.2 1.2

neighbor 0.3 bin
neigh_modify delay 0 every 20 check no

fix 1 all nve

dump dump_traj all atom 1 tryout.lammpstrj

run 100

I attached an input script which shows the 3 behaviors I mentioned. It's
a dummy example with no physics in it. Please run it first as is then
with either of the 1-2 lj pair_coeffs commented out in turn. Look at the
total energy of the system at step 0. When I do that I get 3 different
values. Input script:

...and you should get this

- in the first case you have no 1-2 interaction from lj/cut/coul/cut
- in the second case you disable the LJ part of the 1-2 interaction,
but not the coulomb part
- in the third case you have both LJ and coulomb from the 1-2 interaction.

i see no inconsistent behavior here. everything works as it should.

axel.

Ah thank you Axel, it does look so simple now! I overlooked the Coulomb interaction completely.