force exchange between images and real particles

Dear all,

In modern LAMMPS there is no need in domain->minimal_image since when bondlist is constructed, the pair for every particle is the closest image (similar for angles, dihedrals).

So let assume we have two particles 1 and 2 connected by a bond, but separated by the domain border. So images created for particles 1 and 2.
Thus when forces are computed in bond_something, the force is computed only for the first (real particle) and the second (image particle). The question is where in the code the real particle number 2 gets information about forces (which is stored for image). I cannot find this place.

Dear all,

In modern LAMMPS there is no need in domain->minimal_image since when
bondlist is constructed, the pair for every particle is the closest image
(similar for angles, dihedrals).
So let assume we have two particles 1 and 2 connected by a bond, but
separated by the domain border. So images created for particles 1 and 2.

i don't think that this is a 100% correct description. real "images"
are not created, but they happen implicitly because of the creation of
ghost atoms. those are not only present at the periodic boundaries,
but for every "ghost stencil" around a subbox.

Thus when forces are computed in bond_something, the force is computed only
for the first (real particle) and the second (image particle). The question

no. there are two options. you have "newton bond on" (the default)
then each bond is only listed once. and either both atoms are local
(then your considerations don't apply at all) or one is local and one
is a ghost (you cannot have both be ghosts, of course).
forces are then assigned to the local and the ghost atom on the MPI
tasks where the bond is listed (similar for other bonded and nonbonded
interactions). the accumulated forces on the ghost atoms are then
communicated to the MPI rank that holds the "local" version of the
ghost atom via doing comm->reverse_comm().
for the other option, "newton bond off", the bond is listed twice:
once for each domain or MPI rank where any of the two atoms is a local
atom. then the force is computed twice but only added to the local
atom and comm->reverse_comm() is not needed.

is where in the code the real particle number 2 gets information about
forces (which is stored for image). I cannot find this place.

you cannot, because the procedure is different.

axel.