Fixing more oversights in npair classes

This commit is contained in:
jtclemm
2022-11-11 20:35:52 -07:00
parent c5181bb7c8
commit 11f3195b0c
5 changed files with 17 additions and 21 deletions

View File

@ -106,8 +106,8 @@ void NPairNsqGhost<HALF>::build(NeighList *list)
// stores ghost/ghost pairs only once
// no molecular test when i = ghost atom
if (!HALF) jstart = 0;
else jstart = i + 1;
if (HALF) jstart = i + 1;
else jstart = 0;
if (i < nlocal) {
for (j = jstart; j < nall; j++) {
@ -155,7 +155,10 @@ void NPairNsqGhost<HALF>::build(NeighList *list)
delz = ztmp - x[j][2];
rsq = delx * delx + dely * dely + delz * delz;
if (rsq <= cutneighsq[itype][jtype]) neighptr[n++] = j;
if (HALF) {
if (rsq <= cutneighsq[itype][jtype]) neighptr[n++] = j;
} else {
if (rsq <= cutneighghostsq[itype][jtype]) neighptr[n++] = j;
}
}