bug in fix_gcmc.cpp deletion move when using energy_full with a fix that has a potential energy

hello,

With the new energy_full option of gcmc, fixes which have an associated
potential energy can be used. I am using fix wall for example. Now in a
deletion move, the atom to be deleted is placed in an exclusion group and
the system energy is recalculated. In init() everything is set up with the
neighbor lists to turn off interactions between group "all" and the exclusion
group. So everything works correctly for energies calculated from pair styles.

However, fixes such as fix wall do not use neighbor lists to calculate energy.
In fix_wall_lj1043.cpp for example, the energy is calculated if an atom belongs
to the group that fix_wall was initiated with; even if it is also a member of
the exclusion group. This in turn causes the energy_after deletion to be
calculated incorrectly, messing up the probability of the move.

Hopefully this is enough to explain the bug. If not, I can clean up an input
script and modified source code to make it more clear.

-CBL

Your explanation makes sense. I'll look into a patch for this, probably involving temporary removal of the test deletion atom from the fix wall group.

Paul

Paul,

Thanks for looking into this issue. I like the patch idea that you
proposed, as it is much better than my temporary hack!

-CBL

I've now checked in a fix for this to the LAMMPS repository.

Paul