[lammps-users] Clarification needed in pair_sw.cpp

Hello Steve,

Thank you for all your previous replies. They are very welcome.

Could it be possible for you to clarify me what is the meaning of lines (119-128) in pair_sw.cpp

if (itag > jtag) {
if ((itag+jtag) 2 == 0) continue; } else if (itag < jtag) { if ((itag+jtag) 2 == 1) continue;
} else {
if (x[j][2] < ztmp) continue;
else if (x[j][2] == ztmp && x[j][1] < ytmp) continue;
else if (x[j][2] == ztmp && x[j][1] == ytmp && x[j][0] < xtmp)

In particular the comparisons with ztmp, ytmp and xtmp.

Is it correct to assume that “tags” are the internal id of atoms?

Thank you in advance, Javier

Because SW is using a "full" neighbor list, it means both I,J and J,I are
in the list. The logic below is skipping one of the 2 interactions,
so the I-J is only computed once. The itag,jtag are the IDs of the atoms,
and could be the same for a tiny periodic system with a long cutoff
due to image atoms, hence the ztmp,ytmp test.