# track ghost atoms

Dear all lammps users:

I am trying to write a custom compute style to compute an per atom array for solid system.

1.The calculation is based on geometric configuration, both the current time step and initial time step.
2. Calculation is involved with the atom i and its all nearest neighbors, more exactly speaking the initial and current distance vector Xij for each pair.

The difficulty is for atom i, if one of its neighbor j is a ghost atom in the initial timestep, I can not track it at current timestep, where this atom is or what is its id(ghost id number is > nlocal), since ghost atom are rebuilt. So Xij(t) is unknown because j atom is lost.

I think to solve this problem, I may need to understand how system build these ghost atoms so that I can find its original image. I will be very grateful if any suggestions on this can be given.

Best regards,

Dear all lammps users:

I am trying to write a custom compute style to compute an per atom array for
solid system.

1.The calculation is based on geometric configuration, both the current time
step and initial time step.
2. Calculation is involved with the atom i and its all nearest neighbors,
more exactly speaking the initial and current distance vector Xij for each
pair.

The difficulty is for atom i, if one of its neighbor j is a ghost atom in
the initial timestep, I can not track it at current timestep, where this
atom is or what is its id(ghost id number is > nlocal), since ghost atom are
rebuilt. So Xij(t) is unknown because j atom is lost.

_all_ atoms move around and their local indices
change over time, regardless whether ghost or
local atom. to track unique atoms over a longer
period, use the Atom::map() method instead
which returns global atom ids.

cheers,
axel.

If you have a quantity you have calculated for every
atom in the system, and you want procs to know
what that quantity is for their ghost atoms, then
the way to do it is have your compute call
comm->forward_comm_compute(this).

It assigns the quantity to every ghost atom based on
its actual image atom. See compute cna/atom for
an example of how it is used.

Steve