question about pair_tersoff.cpp

Dear Users,

I have a confusion about how selections are made in computing forces
between neighboring pairs in pair tersoff. It will be great if someone
could comment on it. The code in question is as follows.

......
......

  for (ii = 0; ii < inum; ii++) {
    i = ilist[ii];
    itag = tag[i];
    itype = map[type[i]];
    xtmp = x[i][0];
    ytmp = x[i][1];
    ztmp = x[i][2];

    // two-body interactions, skip half of them

    jlist = firstneigh[i];
    jnum = numneigh[i];

    for (jj = 0; jj < jnum; jj++) {
      j = jlist[jj];
      jtag = tag[j];

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

I could understand in part the use of itag>jtag and itag < jtag if
statements. But could not comprehend how (and why) the selections are
made by comparing x y and z, (if the first two if statements are not
satisfied) coordinates of the atoms.

As far as I understand,

if itag and jtag are both odd and even numbers, it should be
considered if itag < jtag.
  for example, pair (3,5) will be considered and (5,3) will not be considered.

If one is even and other is odd, it should be considered if itag > jtag.
  for example (5,4) will be considered byt (4,5) will not be considered.

I dont know what i am missing in regards to coordinates comparison

Best Regards
Vikas Varshney

Dear Users,

I have a confusion about how selections are made in computing forces
between neighboring pairs in pair tersoff. It will be great if someone
could comment on it. The code in question is as follows.

the answer is in the mailing list archive:

axel.

Dear Axel,
Thank you very much. I really appreciate it.

Best Regards,
Vikas