[lammps-users] Ghost Atoms

Thanks Steve! The reason why I wanted to know about ghost atoms is because in
file pair.cpp of source code, the virial is computed by summing fi.ri over all
atoms (nall = nghost+nlocal). Shouldn't this summation be carried out over only
local atoms? As far as I understand f_pair[i][0] is the net force on ith atom in
x-direction obtained form pair_lj_cut.cpp (for lj/cut potential), am I correct?
Here is the part of code that I am talking about:

You can either compute the virial as Sum Fi ri (sum over owned and
ghost atoms) or as SumI SumJ Fij rij (sum over all pairs). The former
is quicker
but requires forces on ghost atoms to get periodic BC correct. LAMMPS
does it when it can (if there are forces being accumulated on ghost atoms).