Minimum image energy in FixGCMC

Hello LAMMPS users,

I am having some trouble understanding the energy calculation in fix gcmc.
The method " FixGCMC::energy " on line 2105 in fix_gcmc.cpp computes the interaction energy of a single particle with the local+ghost atoms of the processor.
However, the separations delx, dely, delz, used in the energy calculation are not necessarily less than half the box length, so the energy is not always calculated with the minimum image.

Is this wrong or am I missing something?

The class FixGCMC implements the pre_exchange() method from which it calls domain->pbc(); comm->exchange(); comm->borders(); before the energy calculation. But the calculation is not done using the neighbour list. In comparison, force->pair->compute() which is called from the Verlet class and calculates the energy by neighbour list, always calculates using the minimum image.

Thank you in advance,

BestBjorn

Hello LAMMPS users,

I am having some trouble understanding the energy calculation in fix gcmc.
The method " FixGCMC::energy " on line 2105 in fix_gcmc.cpp computes the interaction energy of a single particle with the local+ghost atoms of the processor.
However, the separations delx, dely, delz, used in the energy calculation are not necessarily less than half the box length, so the energy is not always calculated with the minimum image.

Is this wrong or am I missing something?

since LAMMPS uses real copies of periodic images (aka ghost atoms), it is not subject to minimum image conventions and thus cutoffs larger than half the shortest box length are possible and provide meaningful results.

The class FixGCMC implements the pre_exchange() method from which it calls domain->pbc(); comm->exchange(); comm->borders(); before the energy calculation. But the calculation is not done using the neighbour list. In comparison, force->pair->compute() which is called from the Verlet class and calculates the energy by neighbour list, always calculates using the minimum image.

that statement is not correct. neighbor lists in LAMMPS can have large cutoffs than half the box. try the melt example and reduce the box to 0 5 0 5 0 5 and set the cutoff to 5.0, that will result in a cubic box of 8.4 sigma length and you can use a 5 sigma cutoff without a problem.

axel.