# [lammps-users] about MEAM source code

There are always ghost atoms, serial or parallel. The full/half
is for a list that stores each I,J pair once (half) with either
atom I or J, versus each I,J pair twice (full), once with I and
once with J.

Steve

Hi, steve,

Sorry to disturb you again.
I saw that the ghost atoms are only used for eam potential and related, not in potential like tersorff etc, although they’re three-body potential too. I wonder what the reason were you planned to create these ghost atoms. This confused me a lot.

I’v dumped the neighbor list of each atom (in serial version) by adding the following codes in pair_eam.cpp.

for (ii = 0; ii < inum; ii++) {
i = ilist[ii];
jlist = firstneigh[i];
jnum = numneigh[i];
for (jj = 0; jj < jnum; jj++) {
j = jlist[jj];
fprintf(pfile1,"%i %i %i \n",ii,jj,j);
}
}

My simulation system have 4000 atoms. And I used “newton off” command. I assumed inum = 4000, as you can see the output like the following:

For atom 0:
0 0 1
0 1 2
0 2 3
0 3 4
0 5 40
0 7 400
0 9 4400
0 10 4401
0 12 4403
0 15 5280
0 16 5281
0 17 5282
0 21 5721
0 25 6336
0 27 6338
0 28 6339
0 33 6779
0 36 6866

what does these red ghost atoms correspond to? How can i find the “actual” atom index in the original data file?

Another question: My understanding is that only force of those non-ghost atoms are recorded. For example, in the pair_eam.cpp i found

``````	if (newton_pair || j < nlocal) {
coeff = rhor_spline[type2rhor[itype][jtype]][m];
rho[j] += ((coeff[3]*p + coeff[4])*p + coeff[5])*p + coeff[6];

}

and
if (newton_pair || j < nlocal) {
f[j][0] -= delx*fpair;
f[j][1] -= dely*fpair;
f[j][2] -= delz*fpair;
}

If so, now, my question is that for the three-body potentials, i do want to store the force of k due to i and j,

for example in MEAM potentials. How do i do to solve this issue? I'm trying to avoid some double-termed issue here.

Ajing

``````

LAMMPS always creates ghost atoms, even on 1 proc. They are always
in the neighbor lists. All potentials need to deal with them.
So I'm not clear how you are distinguishing EAM vs any other potential.

Whether you loop over the ghost atoms or store force on them
is up to the potential to decide.

what does these red ghost atoms correspond to? How can i find the "actual"
atom index in the original data file?

tag[i] will give you the atom ID of any atom, owned or ghost.

Steve

Thanks, steve,