Changing logic for self-bin check, newton+ortho
This commit is contained in:
@ -185,7 +185,7 @@ void NPairBinGhostOmp<HALF>::build(NeighList *list)
|
|||||||
firstneigh[i] = neighptr;
|
firstneigh[i] = neighptr;
|
||||||
numneigh[i] = n;
|
numneigh[i] = n;
|
||||||
ipage.vgot(n);
|
ipage.vgot(n);
|
||||||
if (ipage.status()) error->one(FLERR,"Neighbor list overflow, boost neigh_modify one");
|
if (ipage.status()) error->one(FLERR, "Neighbor list overflow, boost neigh_modify one");
|
||||||
}
|
}
|
||||||
NPAIR_OMP_CLOSE;
|
NPAIR_OMP_CLOSE;
|
||||||
list->inum = nlocal;
|
list->inum = nlocal;
|
||||||
|
|||||||
@ -117,7 +117,7 @@ void NPairBinOmp<HALF, NEWTON, TRI, SIZE, ATOMONLY>::build(NeighList *list)
|
|||||||
for (k = 0; k < nstencil; k++) {
|
for (k = 0; k < nstencil; k++) {
|
||||||
bin_start = binhead[ibin + stencil[k]];
|
bin_start = binhead[ibin + stencil[k]];
|
||||||
if (HALF && NEWTON && (!TRI)) {
|
if (HALF && NEWTON && (!TRI)) {
|
||||||
if (stencil[k] == 0) {
|
if (k == 0) {
|
||||||
// Half neighbor list, newton on, orthonormal
|
// Half neighbor list, newton on, orthonormal
|
||||||
// loop over rest of atoms in i's bin, ghosts are at end of linked list
|
// loop over rest of atoms in i's bin, ghosts are at end of linked list
|
||||||
bin_start = bins[i];
|
bin_start = bins[i];
|
||||||
@ -163,7 +163,7 @@ void NPairBinOmp<HALF, NEWTON, TRI, SIZE, ATOMONLY>::build(NeighList *list)
|
|||||||
// Half neighbor list, newton on, orthonormal
|
// Half neighbor list, newton on, orthonormal
|
||||||
// store every pair for every bin in stencil, except for i's bin
|
// store every pair for every bin in stencil, except for i's bin
|
||||||
|
|
||||||
if (stencil[k] == 0) {
|
if (k == 0) {
|
||||||
// if j is owned atom, store it, since j is beyond i in linked list
|
// if j is owned atom, store it, since j is beyond i in linked list
|
||||||
// if j is ghost, only store if j coords are "above and to the "right" of i
|
// if j is ghost, only store if j coords are "above and to the "right" of i
|
||||||
if (j >= nlocal) {
|
if (j >= nlocal) {
|
||||||
@ -229,7 +229,7 @@ void NPairBinOmp<HALF, NEWTON, TRI, SIZE, ATOMONLY>::build(NeighList *list)
|
|||||||
if (!moltemplate)
|
if (!moltemplate)
|
||||||
which = find_special(special[i], nspecial[i], tag[j]);
|
which = find_special(special[i], nspecial[i], tag[j]);
|
||||||
else if (imol >= 0)
|
else if (imol >= 0)
|
||||||
which = find_special(onemols[imol]->special[iatom], onemols[imol] ->nspecial[iatom],
|
which = find_special(onemols[imol]->special[iatom], onemols[imol]->nspecial[iatom],
|
||||||
tag[j] - tagprev);
|
tag[j] - tagprev);
|
||||||
else which = 0;
|
else which = 0;
|
||||||
if (which == 0)
|
if (which == 0)
|
||||||
@ -250,7 +250,7 @@ void NPairBinOmp<HALF, NEWTON, TRI, SIZE, ATOMONLY>::build(NeighList *list)
|
|||||||
firstneigh[i] = neighptr;
|
firstneigh[i] = neighptr;
|
||||||
numneigh[i] = n;
|
numneigh[i] = n;
|
||||||
ipage.vgot(n);
|
ipage.vgot(n);
|
||||||
if (ipage.status()) error->one(FLERR,"Neighbor list overflow, boost neigh_modify one");
|
if (ipage.status()) error->one(FLERR, "Neighbor list overflow, boost neigh_modify one");
|
||||||
}
|
}
|
||||||
NPAIR_OMP_CLOSE;
|
NPAIR_OMP_CLOSE;
|
||||||
list->inum = nlocal;
|
list->inum = nlocal;
|
||||||
|
|||||||
@ -106,9 +106,9 @@ void NPairHalffullOmp<NEWTON, TRI, TRIM>::build(NeighList *list)
|
|||||||
if (j < nlocal) {
|
if (j < nlocal) {
|
||||||
if (i > j) continue;
|
if (i > j) continue;
|
||||||
} else if (TRI) {
|
} else if (TRI) {
|
||||||
if (fabs(x[j][2]-ztmp) > delta) {
|
if (fabs(x[j][2] - ztmp) > delta) {
|
||||||
if (x[j][2] < ztmp) continue;
|
if (x[j][2] < ztmp) continue;
|
||||||
} else if (fabs(x[j][1]-ytmp) > delta) {
|
} else if (fabs(x[j][1] - ytmp) > delta) {
|
||||||
if (x[j][1] < ytmp) continue;
|
if (x[j][1] < ytmp) continue;
|
||||||
} else {
|
} else {
|
||||||
if (x[j][0] < xtmp) continue;
|
if (x[j][0] < xtmp) continue;
|
||||||
@ -149,7 +149,7 @@ void NPairHalffullOmp<NEWTON, TRI, TRIM>::build(NeighList *list)
|
|||||||
firstneigh[i] = neighptr;
|
firstneigh[i] = neighptr;
|
||||||
numneigh[i] = n;
|
numneigh[i] = n;
|
||||||
ipage.vgot(n);
|
ipage.vgot(n);
|
||||||
if (ipage.status()) error->one(FLERR,"Neighbor list overflow, boost neigh_modify one");
|
if (ipage.status()) error->one(FLERR, "Neighbor list overflow, boost neigh_modify one");
|
||||||
}
|
}
|
||||||
NPAIR_OMP_CLOSE;
|
NPAIR_OMP_CLOSE;
|
||||||
list->inum = inum_full;
|
list->inum = inum_full;
|
||||||
|
|||||||
@ -119,7 +119,7 @@ void NPairMultiOldOmp<HALF, NEWTON, TRI, SIZE>::build(NeighList *list)
|
|||||||
ns = nstencil_multi_old[itype];
|
ns = nstencil_multi_old[itype];
|
||||||
for (k = 0; k < ns; k++) {
|
for (k = 0; k < ns; k++) {
|
||||||
bin_start = binhead[ibin+s[k]];
|
bin_start = binhead[ibin+s[k]];
|
||||||
if (s[k] == 0) {
|
if (k == 0) {
|
||||||
if (HALF && NEWTON && (!TRI)) {
|
if (HALF && NEWTON && (!TRI)) {
|
||||||
// Half neighbor list, newton on, orthonormal
|
// Half neighbor list, newton on, orthonormal
|
||||||
// loop over rest of atoms in i's bin, ghosts are at end of linked list
|
// loop over rest of atoms in i's bin, ghosts are at end of linked list
|
||||||
@ -166,7 +166,7 @@ void NPairMultiOldOmp<HALF, NEWTON, TRI, SIZE>::build(NeighList *list)
|
|||||||
// Half neighbor list, newton on, orthonormal
|
// Half neighbor list, newton on, orthonormal
|
||||||
// store every pair for every bin in stencil,except for i's bin
|
// store every pair for every bin in stencil,except for i's bin
|
||||||
|
|
||||||
if (s[k] == 0) {
|
if (k == 0) {
|
||||||
// if j is owned atom, store it, since j is beyond i in linked list
|
// if j is owned atom, store it, since j is beyond i in linked list
|
||||||
// if j is ghost, only store if j coords are "above and to the "right" of i
|
// if j is ghost, only store if j coords are "above and to the "right" of i
|
||||||
if (j >= nlocal) {
|
if (j >= nlocal) {
|
||||||
|
|||||||
@ -131,7 +131,7 @@ void NPairMultiOmp<HALF, NEWTON, TRI, SIZE, ATOMONLY>::build(NeighList *list)
|
|||||||
|
|
||||||
// own-bin for half stencil
|
// own-bin for half stencil
|
||||||
if (HALF && !TRI)
|
if (HALF && !TRI)
|
||||||
if (flag_half_multi[icollection][jcollection] && s[k] == 0) js = bins[i];
|
if (k == 0 && flag_half_multi[icollection][jcollection]) js = bins[i];
|
||||||
|
|
||||||
for (j = js; j >= 0; j = bins[j]) {
|
for (j = js; j >= 0; j = bins[j]) {
|
||||||
if (!HALF) {
|
if (!HALF) {
|
||||||
@ -180,24 +180,22 @@ void NPairMultiOmp<HALF, NEWTON, TRI, SIZE, ATOMONLY>::build(NeighList *list)
|
|||||||
} else {
|
} else {
|
||||||
// Half neighbor list, newton on, orthonormal
|
// Half neighbor list, newton on, orthonormal
|
||||||
// if same size: uses half stencil so includes a check of the central bin
|
// if same size: uses half stencil so includes a check of the central bin
|
||||||
if (flag_half_multi[icollection][jcollection]){
|
if (k == 0 && flag_half_multi[icollection][jcollection]) {
|
||||||
if (s[k] == 0) {
|
// if same collection,
|
||||||
// if same collection,
|
// if j is owned atom, store it, since j is beyond i in linked list
|
||||||
// if j is owned atom, store it, since j is beyond i in linked list
|
// if j is ghost, only store if j coords are "above and to the right" of i
|
||||||
// if j is ghost, only store if j coords are "above and to the right" of i
|
|
||||||
|
|
||||||
// if different collections,
|
// if different collections,
|
||||||
// if j is owned atom, store it if j > i
|
// if j is owned atom, store it if j > i
|
||||||
// if j is ghost, only store if j coords are "above and to the right" of i
|
// if j is ghost, only store if j coords are "above and to the right" of i
|
||||||
|
|
||||||
if ((icollection != jcollection) && (j < i)) continue;
|
if ((icollection != jcollection) && (j < i)) continue;
|
||||||
|
|
||||||
if (j >= nlocal) {
|
if (j >= nlocal) {
|
||||||
if (x[j][2] < ztmp) continue;
|
if (x[j][2] < ztmp) continue;
|
||||||
if (x[j][2] == ztmp) {
|
if (x[j][2] == ztmp) {
|
||||||
if (x[j][1] < ytmp) continue;
|
if (x[j][1] < ytmp) continue;
|
||||||
if (x[j][1] == ytmp && x[j][0] < xtmp) continue;
|
if (x[j][1] == ytmp && x[j][0] < xtmp) continue;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -233,7 +231,7 @@ void NPairMultiOmp<HALF, NEWTON, TRI, SIZE, ATOMONLY>::build(NeighList *list)
|
|||||||
if (!moltemplate)
|
if (!moltemplate)
|
||||||
which = find_special(special[i], nspecial[i], tag[j]);
|
which = find_special(special[i], nspecial[i], tag[j]);
|
||||||
else if (imol >= 0)
|
else if (imol >= 0)
|
||||||
which = find_special(onemols[imol]->special[iatom], onemols [imol]->nspecial[iatom],
|
which = find_special(onemols[imol]->special[iatom], onemols[imol]->nspecial[iatom],
|
||||||
tag[j] - tagprev);
|
tag[j] - tagprev);
|
||||||
else
|
else
|
||||||
which = 0;
|
which = 0;
|
||||||
@ -256,7 +254,7 @@ void NPairMultiOmp<HALF, NEWTON, TRI, SIZE, ATOMONLY>::build(NeighList *list)
|
|||||||
if (!moltemplate)
|
if (!moltemplate)
|
||||||
which = find_special(special[i], nspecial[i], tag[j]);
|
which = find_special(special[i], nspecial[i], tag[j]);
|
||||||
else if (imol >= 0)
|
else if (imol >= 0)
|
||||||
which = find_special(onemols[imol]->special[iatom], onemols [imol]->nspecial[iatom],
|
which = find_special(onemols[imol]->special[iatom], onemols[imol]->nspecial[iatom],
|
||||||
tag[j] - tagprev);
|
tag[j] - tagprev);
|
||||||
else
|
else
|
||||||
which = 0;
|
which = 0;
|
||||||
@ -279,7 +277,7 @@ void NPairMultiOmp<HALF, NEWTON, TRI, SIZE, ATOMONLY>::build(NeighList *list)
|
|||||||
firstneigh[i] = neighptr;
|
firstneigh[i] = neighptr;
|
||||||
numneigh[i] = n;
|
numneigh[i] = n;
|
||||||
ipage.vgot(n);
|
ipage.vgot(n);
|
||||||
if (ipage.status()) error->one(FLERR,"Neighbor list overflow, boost neigh_modify one");
|
if (ipage.status()) error->one(FLERR, "Neighbor list overflow, boost neigh_modify one");
|
||||||
}
|
}
|
||||||
NPAIR_OMP_CLOSE;
|
NPAIR_OMP_CLOSE;
|
||||||
list->inum = nlocal;
|
list->inum = nlocal;
|
||||||
|
|||||||
@ -172,7 +172,7 @@ void NPairNsqGhostOmp<HALF>::build(NeighList *list)
|
|||||||
firstneigh[i] = neighptr;
|
firstneigh[i] = neighptr;
|
||||||
numneigh[i] = n;
|
numneigh[i] = n;
|
||||||
ipage.vgot(n);
|
ipage.vgot(n);
|
||||||
if (ipage.status()) error->one(FLERR,"Neighbor list overflow, boost neigh_modify one");
|
if (ipage.status()) error->one(FLERR, "Neighbor list overflow, boost neigh_modify one");
|
||||||
}
|
}
|
||||||
NPAIR_OMP_CLOSE;
|
NPAIR_OMP_CLOSE;
|
||||||
list->inum = nlocal;
|
list->inum = nlocal;
|
||||||
|
|||||||
@ -137,9 +137,9 @@ void NPairNsqOmp<HALF, NEWTON, TRI, SIZE>::build(NeighList *list)
|
|||||||
if (j >= nlocal) {
|
if (j >= nlocal) {
|
||||||
jtag = tag[j];
|
jtag = tag[j];
|
||||||
if (itag > jtag) {
|
if (itag > jtag) {
|
||||||
if ((itag+jtag) % 2 == 0) continue;
|
if ((itag + jtag) % 2 == 0) continue;
|
||||||
} else if (itag < jtag) {
|
} else if (itag < jtag) {
|
||||||
if ((itag+jtag) % 2 == 1) continue;
|
if ((itag + jtag) % 2 == 1) continue;
|
||||||
} else if (TRI) {
|
} else if (TRI) {
|
||||||
if (fabs(x[j][2] - ztmp) > delta) {
|
if (fabs(x[j][2] - ztmp) > delta) {
|
||||||
if (x[j][2] < ztmp) continue;
|
if (x[j][2] < ztmp) continue;
|
||||||
@ -219,7 +219,7 @@ void NPairNsqOmp<HALF, NEWTON, TRI, SIZE>::build(NeighList *list)
|
|||||||
firstneigh[i] = neighptr;
|
firstneigh[i] = neighptr;
|
||||||
numneigh[i] = n;
|
numneigh[i] = n;
|
||||||
ipage.vgot(n);
|
ipage.vgot(n);
|
||||||
if (ipage.status()) error->one(FLERR,"Neighbor list overflow, boost neigh_modify one");
|
if (ipage.status()) error->one(FLERR, "Neighbor list overflow, boost neigh_modify one");
|
||||||
}
|
}
|
||||||
NPAIR_OMP_CLOSE;
|
NPAIR_OMP_CLOSE;
|
||||||
list->inum = nlocal;
|
list->inum = nlocal;
|
||||||
|
|||||||
@ -88,7 +88,7 @@ void NPairRespaBinOmp<NEWTON, TRI>::build(NeighList *list)
|
|||||||
int *numneigh_inner = list->numneigh_inner;
|
int *numneigh_inner = list->numneigh_inner;
|
||||||
int **firstneigh_inner = list->firstneigh_inner;
|
int **firstneigh_inner = list->firstneigh_inner;
|
||||||
|
|
||||||
int *ilist_middle,*numneigh_middle,**firstneigh_middle;
|
int *ilist_middle, *numneigh_middle, **firstneigh_middle;
|
||||||
if (respamiddle) {
|
if (respamiddle) {
|
||||||
ilist_middle = list->ilist_middle;
|
ilist_middle = list->ilist_middle;
|
||||||
numneigh_middle = list->numneigh_middle;
|
numneigh_middle = list->numneigh_middle;
|
||||||
@ -133,9 +133,9 @@ void NPairRespaBinOmp<NEWTON, TRI>::build(NeighList *list)
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (k = 0; k < nstencil; k++) {
|
for (k = 0; k < nstencil; k++) {
|
||||||
bin_start = binhead[ibin+stencil[k]];
|
bin_start = binhead[ibin + stencil[k]];
|
||||||
if (NEWTON && (!TRI)) {
|
if (NEWTON && (!TRI)) {
|
||||||
if (stencil[k] == 0) {
|
if (k == 0) {
|
||||||
// Half neighbor list, newton on, orthonormal
|
// Half neighbor list, newton on, orthonormal
|
||||||
// loop over rest of atoms in i's bin, ghosts are at end of linked list
|
// loop over rest of atoms in i's bin, ghosts are at end of linked list
|
||||||
bin_start = bins[i];
|
bin_start = bins[i];
|
||||||
@ -177,7 +177,7 @@ void NPairRespaBinOmp<NEWTON, TRI>::build(NeighList *list)
|
|||||||
// Half neighbor list, newton on, orthonormal
|
// Half neighbor list, newton on, orthonormal
|
||||||
// store every pair for every bin in stencil,except for i's bin
|
// store every pair for every bin in stencil,except for i's bin
|
||||||
|
|
||||||
if (stencil[k] == 0) {
|
if (k == 0) {
|
||||||
// if j is owned atom, store it, since j is beyond i in linked list
|
// if j is owned atom, store it, since j is beyond i in linked list
|
||||||
// if j is ghost, only store if j coords are "above and to the "right" of i
|
// if j is ghost, only store if j coords are "above and to the "right" of i
|
||||||
if (j >= nlocal) {
|
if (j >= nlocal) {
|
||||||
@ -242,20 +242,20 @@ void NPairRespaBinOmp<NEWTON, TRI>::build(NeighList *list)
|
|||||||
firstneigh[i] = neighptr;
|
firstneigh[i] = neighptr;
|
||||||
numneigh[i] = n;
|
numneigh[i] = n;
|
||||||
ipage.vgot(n);
|
ipage.vgot(n);
|
||||||
if (ipage.status()) error->one(FLERR,"Neighbor list overflow, boost neigh_modify one");
|
if (ipage.status()) error->one(FLERR, "Neighbor list overflow, boost neigh_modify one");
|
||||||
|
|
||||||
ilist_inner[i] = i;
|
ilist_inner[i] = i;
|
||||||
firstneigh_inner[i] = neighptr_inner;
|
firstneigh_inner[i] = neighptr_inner;
|
||||||
numneigh_inner[i] = n_inner;
|
numneigh_inner[i] = n_inner;
|
||||||
ipage.vgot(n_inner);
|
ipage.vgot(n_inner);
|
||||||
if (ipage_inner.status()) error->one(FLERR,"Neighbor list overflow, boost neigh_modify one");
|
if (ipage_inner.status()) error->one(FLERR, "Neighbor list overflow, boost neigh_modify one");
|
||||||
|
|
||||||
if (respamiddle) {
|
if (respamiddle) {
|
||||||
ilist_middle[i] = i;
|
ilist_middle[i] = i;
|
||||||
firstneigh_middle[i] = neighptr_middle;
|
firstneigh_middle[i] = neighptr_middle;
|
||||||
numneigh_middle[i] = n_middle;
|
numneigh_middle[i] = n_middle;
|
||||||
ipage_middle->vgot(n_middle);
|
ipage_middle->vgot(n_middle);
|
||||||
if (ipage_middle->status()) error->one(FLERR,"Neighbor list overflow, boost neigh_modify one");
|
if (ipage_middle->status()) error->one(FLERR, "Neighbor list overflow, boost neigh_modify one");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
NPAIR_OMP_CLOSE;
|
NPAIR_OMP_CLOSE;
|
||||||
|
|||||||
@ -99,7 +99,7 @@ void NPairRespaNsqOmp<NEWTON, TRI>::build(NeighList *list)
|
|||||||
int *numneigh_inner = list->numneigh_inner;
|
int *numneigh_inner = list->numneigh_inner;
|
||||||
int **firstneigh_inner = list->firstneigh_inner;
|
int **firstneigh_inner = list->firstneigh_inner;
|
||||||
|
|
||||||
int *ilist_middle,*numneigh_middle,**firstneigh_middle;
|
int *ilist_middle, *numneigh_middle, **firstneigh_middle;
|
||||||
if (respamiddle) {
|
if (respamiddle) {
|
||||||
ilist_middle = list->ilist_middle;
|
ilist_middle = list->ilist_middle;
|
||||||
numneigh_middle = list->numneigh_middle;
|
numneigh_middle = list->numneigh_middle;
|
||||||
@ -222,20 +222,20 @@ void NPairRespaNsqOmp<NEWTON, TRI>::build(NeighList *list)
|
|||||||
firstneigh[i] = neighptr;
|
firstneigh[i] = neighptr;
|
||||||
numneigh[i] = n;
|
numneigh[i] = n;
|
||||||
ipage.vgot(n);
|
ipage.vgot(n);
|
||||||
if (ipage.status()) error->one(FLERR,"Neighbor list overflow, boost neigh_modify one");
|
if (ipage.status()) error->one(FLERR, "Neighbor list overflow, boost neigh_modify one");
|
||||||
|
|
||||||
ilist_inner[i] = i;
|
ilist_inner[i] = i;
|
||||||
firstneigh_inner[i] = neighptr_inner;
|
firstneigh_inner[i] = neighptr_inner;
|
||||||
numneigh_inner[i] = n_inner;
|
numneigh_inner[i] = n_inner;
|
||||||
ipage.vgot(n_inner);
|
ipage.vgot(n_inner);
|
||||||
if (ipage_inner.status()) error->one(FLERR,"Neighbor list overflow, boost neigh_modify one");
|
if (ipage_inner.status()) error->one(FLERR, "Neighbor list overflow, boost neigh_modify one");
|
||||||
|
|
||||||
if (respamiddle) {
|
if (respamiddle) {
|
||||||
ilist_middle[i] = i;
|
ilist_middle[i] = i;
|
||||||
firstneigh_middle[i] = neighptr_middle;
|
firstneigh_middle[i] = neighptr_middle;
|
||||||
numneigh_middle[i] = n_middle;
|
numneigh_middle[i] = n_middle;
|
||||||
ipage_middle->vgot(n_middle);
|
ipage_middle->vgot(n_middle);
|
||||||
if (ipage_middle->status()) error->one(FLERR,"Neighbor list overflow, boost neigh_modify one");
|
if (ipage_middle->status()) error->one(FLERR, "Neighbor list overflow, boost neigh_modify one");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
NPAIR_OMP_CLOSE;
|
NPAIR_OMP_CLOSE;
|
||||||
|
|||||||
@ -98,7 +98,7 @@ void NPairTrimOmp::build(NeighList *list)
|
|||||||
firstneigh[i] = neighptr;
|
firstneigh[i] = neighptr;
|
||||||
numneigh[i] = n;
|
numneigh[i] = n;
|
||||||
ipage.vgot(n);
|
ipage.vgot(n);
|
||||||
if (ipage.status()) error->one(FLERR,"Neighbor list overflow, boost neigh_modify one");
|
if (ipage.status()) error->one(FLERR, "Neighbor list overflow, boost neigh_modify one");
|
||||||
}
|
}
|
||||||
NPAIR_OMP_CLOSE;
|
NPAIR_OMP_CLOSE;
|
||||||
list->inum = inum_copy;
|
list->inum = inum_copy;
|
||||||
|
|||||||
@ -110,7 +110,7 @@ void NPairBin<HALF, NEWTON, TRI, SIZE, ATOMONLY>::build(NeighList *list)
|
|||||||
for (k = 0; k < nstencil; k++) {
|
for (k = 0; k < nstencil; k++) {
|
||||||
bin_start = binhead[ibin + stencil[k]];
|
bin_start = binhead[ibin + stencil[k]];
|
||||||
if (HALF && NEWTON && (!TRI)) {
|
if (HALF && NEWTON && (!TRI)) {
|
||||||
if (stencil[k] == 0) {
|
if (k == 0) {
|
||||||
// Half neighbor list, newton on, orthonormal
|
// Half neighbor list, newton on, orthonormal
|
||||||
// loop over rest of atoms in i's bin, ghosts are at end of linked list
|
// loop over rest of atoms in i's bin, ghosts are at end of linked list
|
||||||
bin_start = bins[i];
|
bin_start = bins[i];
|
||||||
@ -155,7 +155,7 @@ void NPairBin<HALF, NEWTON, TRI, SIZE, ATOMONLY>::build(NeighList *list)
|
|||||||
// Half neighbor list, newton on, orthonormal
|
// Half neighbor list, newton on, orthonormal
|
||||||
// store every pair for every bin in stencil, except for i's bin
|
// store every pair for every bin in stencil, except for i's bin
|
||||||
|
|
||||||
if (stencil[k] == 0) {
|
if (k == 0) {
|
||||||
// if j is owned atom, store it, since j is beyond i in linked list
|
// if j is owned atom, store it, since j is beyond i in linked list
|
||||||
// if j is ghost, only store if j coords are "above and to the "right" of i
|
// if j is ghost, only store if j coords are "above and to the "right" of i
|
||||||
if (j >= nlocal) {
|
if (j >= nlocal) {
|
||||||
@ -198,7 +198,7 @@ void NPairBin<HALF, NEWTON, TRI, SIZE, ATOMONLY>::build(NeighList *list)
|
|||||||
if (!moltemplate)
|
if (!moltemplate)
|
||||||
which = find_special(special[i], nspecial[i], tag[j]);
|
which = find_special(special[i], nspecial[i], tag[j]);
|
||||||
else if (imol >= 0)
|
else if (imol >= 0)
|
||||||
which = find_special(onemols[imol]->special[iatom], onemols [imol]->nspecial[iatom],
|
which = find_special(onemols[imol]->special[iatom], onemols[imol]->nspecial[iatom],
|
||||||
tag[j] - tagprev);
|
tag[j] - tagprev);
|
||||||
else
|
else
|
||||||
which = 0;
|
which = 0;
|
||||||
@ -221,7 +221,7 @@ void NPairBin<HALF, NEWTON, TRI, SIZE, ATOMONLY>::build(NeighList *list)
|
|||||||
if (!moltemplate)
|
if (!moltemplate)
|
||||||
which = find_special(special[i], nspecial[i], tag[j]);
|
which = find_special(special[i], nspecial[i], tag[j]);
|
||||||
else if (imol >= 0)
|
else if (imol >= 0)
|
||||||
which = find_special(onemols[imol]->special[iatom], onemols [imol]->nspecial[iatom],
|
which = find_special(onemols[imol]->special[iatom], onemols[imol]->nspecial[iatom],
|
||||||
tag[j] - tagprev);
|
tag[j] - tagprev);
|
||||||
else
|
else
|
||||||
which = 0;
|
which = 0;
|
||||||
@ -243,7 +243,7 @@ void NPairBin<HALF, NEWTON, TRI, SIZE, ATOMONLY>::build(NeighList *list)
|
|||||||
firstneigh[i] = neighptr;
|
firstneigh[i] = neighptr;
|
||||||
numneigh[i] = n;
|
numneigh[i] = n;
|
||||||
ipage->vgot(n);
|
ipage->vgot(n);
|
||||||
if (ipage->status()) error->one(FLERR,"Neighbor list overflow, boost neigh_modify one");
|
if (ipage->status()) error->one(FLERR, "Neighbor list overflow, boost neigh_modify one");
|
||||||
}
|
}
|
||||||
|
|
||||||
list->inum = inum;
|
list->inum = inum;
|
||||||
|
|||||||
@ -128,7 +128,7 @@ void NPairMulti<HALF, NEWTON, TRI, SIZE, ATOMONLY>::build(NeighList *list)
|
|||||||
|
|
||||||
// own-bin for half stencil
|
// own-bin for half stencil
|
||||||
if (HALF && !TRI)
|
if (HALF && !TRI)
|
||||||
if (flag_half_multi[icollection][jcollection] && s[k] == 0) js = bins[i];
|
if (k == 0 && flag_half_multi[icollection][jcollection]) js = bins[i];
|
||||||
|
|
||||||
for (j = js; j >= 0; j = bins[j]) {
|
for (j = js; j >= 0; j = bins[j]) {
|
||||||
if (!HALF) {
|
if (!HALF) {
|
||||||
@ -177,24 +177,22 @@ void NPairMulti<HALF, NEWTON, TRI, SIZE, ATOMONLY>::build(NeighList *list)
|
|||||||
} else {
|
} else {
|
||||||
// Half neighbor list, newton on, orthonormal
|
// Half neighbor list, newton on, orthonormal
|
||||||
// if same size: uses half stencil so includes a check of the central bin
|
// if same size: uses half stencil so includes a check of the central bin
|
||||||
if (flag_half_multi[icollection][jcollection]) {
|
if (k == 0 && flag_half_multi[icollection][jcollection]) {
|
||||||
if (s[k] == 0) {
|
// if same collection,
|
||||||
// if same collection,
|
// if j is owned atom, store it, since j is beyond i in linked list
|
||||||
// if j is owned atom, store it, since j is beyond i in linked list
|
// if j is ghost, only store if j coords are "above and to the right" of i
|
||||||
// if j is ghost, only store if j coords are "above and to the right" of i
|
|
||||||
|
|
||||||
// if different collections,
|
// if different collections,
|
||||||
// if j is owned atom, store it if j > i
|
// if j is owned atom, store it if j > i
|
||||||
// if j is ghost, only store if j coords are "above and to the right" of i
|
// if j is ghost, only store if j coords are "above and to the right" of i
|
||||||
|
|
||||||
if ((icollection != jcollection) && (j < i)) continue;
|
if ((icollection != jcollection) && (j < i)) continue;
|
||||||
|
|
||||||
if (j >= nlocal) {
|
if (j >= nlocal) {
|
||||||
if (x[j][2] < ztmp) continue;
|
if (x[j][2] < ztmp) continue;
|
||||||
if (x[j][2] == ztmp) {
|
if (x[j][2] == ztmp) {
|
||||||
if (x[j][1] < ytmp) continue;
|
if (x[j][1] < ytmp) continue;
|
||||||
if (x[j][1] == ytmp && x[j][0] < xtmp) continue;
|
if (x[j][1] == ytmp && x[j][0] < xtmp) continue;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -230,7 +228,7 @@ void NPairMulti<HALF, NEWTON, TRI, SIZE, ATOMONLY>::build(NeighList *list)
|
|||||||
if (!moltemplate)
|
if (!moltemplate)
|
||||||
which = find_special(special[i], nspecial[i], tag[j]);
|
which = find_special(special[i], nspecial[i], tag[j]);
|
||||||
else if (imol >= 0)
|
else if (imol >= 0)
|
||||||
which = find_special(onemols[imol]->special[iatom], onemols [imol]->nspecial[iatom],
|
which = find_special(onemols[imol]->special[iatom], onemols[imol]->nspecial[iatom],
|
||||||
tag[j] - tagprev);
|
tag[j] - tagprev);
|
||||||
else
|
else
|
||||||
which = 0;
|
which = 0;
|
||||||
@ -253,7 +251,7 @@ void NPairMulti<HALF, NEWTON, TRI, SIZE, ATOMONLY>::build(NeighList *list)
|
|||||||
if (!moltemplate)
|
if (!moltemplate)
|
||||||
which = find_special(special[i], nspecial[i], tag[j]);
|
which = find_special(special[i], nspecial[i], tag[j]);
|
||||||
else if (imol >= 0)
|
else if (imol >= 0)
|
||||||
which = find_special(onemols[imol]->special[iatom], onemols [imol]->nspecial[iatom],
|
which = find_special(onemols[imol]->special[iatom], onemols[imol]->nspecial[iatom],
|
||||||
tag[j] - tagprev);
|
tag[j] - tagprev);
|
||||||
else
|
else
|
||||||
which = 0;
|
which = 0;
|
||||||
@ -276,7 +274,7 @@ void NPairMulti<HALF, NEWTON, TRI, SIZE, ATOMONLY>::build(NeighList *list)
|
|||||||
firstneigh[i] = neighptr;
|
firstneigh[i] = neighptr;
|
||||||
numneigh[i] = n;
|
numneigh[i] = n;
|
||||||
ipage->vgot(n);
|
ipage->vgot(n);
|
||||||
if (ipage->status()) error->one(FLERR,"Neighbor list overflow, boost neigh_modify one");
|
if (ipage->status()) error->one(FLERR, "Neighbor list overflow, boost neigh_modify one");
|
||||||
}
|
}
|
||||||
|
|
||||||
list->inum = inum;
|
list->inum = inum;
|
||||||
|
|||||||
@ -113,7 +113,7 @@ void NPairMultiOld<HALF, NEWTON, TRI, SIZE>::build(NeighList *list)
|
|||||||
for (k = 0; k < ns; k++) {
|
for (k = 0; k < ns; k++) {
|
||||||
bin_start = binhead[ibin + s[k]];
|
bin_start = binhead[ibin + s[k]];
|
||||||
if (HALF && NEWTON && (!TRI)) {
|
if (HALF && NEWTON && (!TRI)) {
|
||||||
if (s[k] == 0) {
|
if (k == 0) {
|
||||||
// Half neighbor list, newton on, orthonormal
|
// Half neighbor list, newton on, orthonormal
|
||||||
// loop over rest of atoms in i's bin, ghosts are at end of linked list
|
// loop over rest of atoms in i's bin, ghosts are at end of linked list
|
||||||
bin_start = bins[i];
|
bin_start = bins[i];
|
||||||
@ -159,7 +159,7 @@ void NPairMultiOld<HALF, NEWTON, TRI, SIZE>::build(NeighList *list)
|
|||||||
// Half neighbor list, newton on, orthonormal
|
// Half neighbor list, newton on, orthonormal
|
||||||
// store every pair for every bin in stencil,except for i's bin
|
// store every pair for every bin in stencil,except for i's bin
|
||||||
|
|
||||||
if (s[k] == 0) {
|
if (k == 0) {
|
||||||
// if j is owned atom, store it, since j is beyond i in linked list
|
// if j is owned atom, store it, since j is beyond i in linked list
|
||||||
// if j is ghost, only store if j coords are "above and to the "right" of i
|
// if j is ghost, only store if j coords are "above and to the "right" of i
|
||||||
if (j >= nlocal) {
|
if (j >= nlocal) {
|
||||||
@ -236,7 +236,7 @@ void NPairMultiOld<HALF, NEWTON, TRI, SIZE>::build(NeighList *list)
|
|||||||
firstneigh[i] = neighptr;
|
firstneigh[i] = neighptr;
|
||||||
numneigh[i] = n;
|
numneigh[i] = n;
|
||||||
ipage->vgot(n);
|
ipage->vgot(n);
|
||||||
if (ipage->status()) error->one(FLERR,"Neighbor list overflow, boost neigh_modify one");
|
if (ipage->status()) error->one(FLERR, "Neighbor list overflow, boost neigh_modify one");
|
||||||
}
|
}
|
||||||
|
|
||||||
list->inum = inum;
|
list->inum = inum;
|
||||||
|
|||||||
@ -211,7 +211,7 @@ void NPairNsq<HALF, NEWTON, TRI, SIZE>::build(NeighList *list)
|
|||||||
firstneigh[i] = neighptr;
|
firstneigh[i] = neighptr;
|
||||||
numneigh[i] = n;
|
numneigh[i] = n;
|
||||||
ipage->vgot(n);
|
ipage->vgot(n);
|
||||||
if (ipage->status()) error->one(FLERR,"Neighbor list overflow, boost neigh_modify one");
|
if (ipage->status()) error->one(FLERR, "Neighbor list overflow, boost neigh_modify one");
|
||||||
}
|
}
|
||||||
|
|
||||||
list->inum = inum;
|
list->inum = inum;
|
||||||
|
|||||||
@ -81,7 +81,7 @@ void NPairRespaBin<NEWTON, TRI>::build(NeighList *list)
|
|||||||
int **firstneigh_inner = list->firstneigh_inner;
|
int **firstneigh_inner = list->firstneigh_inner;
|
||||||
MyPage<int> *ipage_inner = list->ipage_inner;
|
MyPage<int> *ipage_inner = list->ipage_inner;
|
||||||
|
|
||||||
int *ilist_middle,*numneigh_middle,**firstneigh_middle;
|
int *ilist_middle, *numneigh_middle, **firstneigh_middle;
|
||||||
MyPage<int> *ipage_middle;
|
MyPage<int> *ipage_middle;
|
||||||
int respamiddle = list->respamiddle;
|
int respamiddle = list->respamiddle;
|
||||||
if (respamiddle) {
|
if (respamiddle) {
|
||||||
@ -123,7 +123,7 @@ void NPairRespaBin<NEWTON, TRI>::build(NeighList *list)
|
|||||||
for (k = 0; k < nstencil; k++) {
|
for (k = 0; k < nstencil; k++) {
|
||||||
bin_start = binhead[ibin+stencil[k]];
|
bin_start = binhead[ibin+stencil[k]];
|
||||||
if (NEWTON && (!TRI)) {
|
if (NEWTON && (!TRI)) {
|
||||||
if (stencil[k] == 0) {
|
if (k == 0) {
|
||||||
// Half neighbor list, newton on, orthonormal
|
// Half neighbor list, newton on, orthonormal
|
||||||
// loop over rest of atoms in i's bin, ghosts are at end of linked list
|
// loop over rest of atoms in i's bin, ghosts are at end of linked list
|
||||||
bin_start = bins[i];
|
bin_start = bins[i];
|
||||||
@ -165,7 +165,7 @@ void NPairRespaBin<NEWTON, TRI>::build(NeighList *list)
|
|||||||
// Half neighbor list, newton on, orthonormal
|
// Half neighbor list, newton on, orthonormal
|
||||||
// store every pair for every bin in stencil,except for i's bin
|
// store every pair for every bin in stencil,except for i's bin
|
||||||
|
|
||||||
if (stencil[k] == 0) {
|
if (k == 0) {
|
||||||
// if j is owned atom, store it, since j is beyond i in linked list
|
// if j is owned atom, store it, since j is beyond i in linked list
|
||||||
// if j is ghost, only store if j coords are "above and to the "right" of i
|
// if j is ghost, only store if j coords are "above and to the "right" of i
|
||||||
if (j >= nlocal) {
|
if (j >= nlocal) {
|
||||||
@ -230,20 +230,20 @@ void NPairRespaBin<NEWTON, TRI>::build(NeighList *list)
|
|||||||
firstneigh[i] = neighptr;
|
firstneigh[i] = neighptr;
|
||||||
numneigh[i] = n;
|
numneigh[i] = n;
|
||||||
ipage->vgot(n);
|
ipage->vgot(n);
|
||||||
if (ipage->status()) error->one(FLERR,"Neighbor list overflow, boost neigh_modify one");
|
if (ipage->status()) error->one(FLERR, "Neighbor list overflow, boost neigh_modify one");
|
||||||
|
|
||||||
ilist_inner[inum] = i;
|
ilist_inner[inum] = i;
|
||||||
firstneigh_inner[i] = neighptr_inner;
|
firstneigh_inner[i] = neighptr_inner;
|
||||||
numneigh_inner[i] = n_inner;
|
numneigh_inner[i] = n_inner;
|
||||||
ipage_inner->vgot(n_inner);
|
ipage_inner->vgot(n_inner);
|
||||||
if (ipage_inner->status()) error->one(FLERR,"Neighbor list overflow, boost neigh_modify one");
|
if (ipage_inner->status()) error->one(FLERR, "Neighbor list overflow, boost neigh_modify one");
|
||||||
|
|
||||||
if (respamiddle) {
|
if (respamiddle) {
|
||||||
ilist_middle[inum] = i;
|
ilist_middle[inum] = i;
|
||||||
firstneigh_middle[i] = neighptr_middle;
|
firstneigh_middle[i] = neighptr_middle;
|
||||||
numneigh_middle[i] = n_middle;
|
numneigh_middle[i] = n_middle;
|
||||||
ipage_middle->vgot(n_middle);
|
ipage_middle->vgot(n_middle);
|
||||||
if (ipage_middle->status()) error->one(FLERR,"Neighbor list overflow, boost neigh_modify one");
|
if (ipage_middle->status()) error->one(FLERR, "Neighbor list overflow, boost neigh_modify one");
|
||||||
}
|
}
|
||||||
|
|
||||||
inum++;
|
inum++;
|
||||||
|
|||||||
@ -92,7 +92,7 @@ void NPairRespaNsq<NEWTON, TRI>::build(NeighList *list)
|
|||||||
int **firstneigh_inner = list->firstneigh_inner;
|
int **firstneigh_inner = list->firstneigh_inner;
|
||||||
MyPage<int> *ipage_inner = list->ipage_inner;
|
MyPage<int> *ipage_inner = list->ipage_inner;
|
||||||
|
|
||||||
int *ilist_middle,*numneigh_middle,**firstneigh_middle;
|
int *ilist_middle, *numneigh_middle, **firstneigh_middle;
|
||||||
MyPage<int> *ipage_middle;
|
MyPage<int> *ipage_middle;
|
||||||
int respamiddle = list->respamiddle;
|
int respamiddle = list->respamiddle;
|
||||||
if (respamiddle) {
|
if (respamiddle) {
|
||||||
@ -215,20 +215,20 @@ void NPairRespaNsq<NEWTON, TRI>::build(NeighList *list)
|
|||||||
firstneigh[i] = neighptr;
|
firstneigh[i] = neighptr;
|
||||||
numneigh[i] = n;
|
numneigh[i] = n;
|
||||||
ipage->vgot(n);
|
ipage->vgot(n);
|
||||||
if (ipage->status()) error->one(FLERR,"Neighbor list overflow, boost neigh_modify one");
|
if (ipage->status()) error->one(FLERR, "Neighbor list overflow, boost neigh_modify one");
|
||||||
|
|
||||||
ilist_inner[inum] = i;
|
ilist_inner[inum] = i;
|
||||||
firstneigh_inner[i] = neighptr_inner;
|
firstneigh_inner[i] = neighptr_inner;
|
||||||
numneigh_inner[i] = n_inner;
|
numneigh_inner[i] = n_inner;
|
||||||
ipage_inner->vgot(n_inner);
|
ipage_inner->vgot(n_inner);
|
||||||
if (ipage_inner->status()) error->one(FLERR,"Neighbor list overflow, boost neigh_modify one");
|
if (ipage_inner->status()) error->one(FLERR, "Neighbor list overflow, boost neigh_modify one");
|
||||||
|
|
||||||
if (respamiddle) {
|
if (respamiddle) {
|
||||||
ilist_middle[inum] = i;
|
ilist_middle[inum] = i;
|
||||||
firstneigh_middle[i] = neighptr_middle;
|
firstneigh_middle[i] = neighptr_middle;
|
||||||
numneigh_middle[i] = n_middle;
|
numneigh_middle[i] = n_middle;
|
||||||
ipage_middle->vgot(n_middle);
|
ipage_middle->vgot(n_middle);
|
||||||
if (ipage_middle->status()) error->one(FLERR,"Neighbor list overflow, boost neigh_modify one");
|
if (ipage_middle->status()) error->one(FLERR, "Neighbor list overflow, boost neigh_modify one");
|
||||||
}
|
}
|
||||||
|
|
||||||
inum++;
|
inum++;
|
||||||
|
|||||||
@ -58,9 +58,9 @@ void NPairSkipRespa::build(NeighList *list)
|
|||||||
int *numneigh_inner_skip = list->listskip->numneigh_inner;
|
int *numneigh_inner_skip = list->listskip->numneigh_inner;
|
||||||
int **firstneigh_inner_skip = list->listskip->firstneigh_inner;
|
int **firstneigh_inner_skip = list->listskip->firstneigh_inner;
|
||||||
|
|
||||||
int *ilist_middle,*numneigh_middle,**firstneigh_middle;
|
int *ilist_middle, *numneigh_middle, **firstneigh_middle;
|
||||||
MyPage<int> *ipage_middle;
|
MyPage<int> *ipage_middle;
|
||||||
int *numneigh_middle_skip,**firstneigh_middle_skip;
|
int *numneigh_middle_skip, **firstneigh_middle_skip;
|
||||||
int respamiddle = list->respamiddle;
|
int respamiddle = list->respamiddle;
|
||||||
if (respamiddle) {
|
if (respamiddle) {
|
||||||
ilist_middle = list->ilist_middle;
|
ilist_middle = list->ilist_middle;
|
||||||
@ -135,20 +135,20 @@ void NPairSkipRespa::build(NeighList *list)
|
|||||||
firstneigh[i] = neighptr;
|
firstneigh[i] = neighptr;
|
||||||
numneigh[i] = n;
|
numneigh[i] = n;
|
||||||
ipage->vgot(n);
|
ipage->vgot(n);
|
||||||
if (ipage->status()) error->one(FLERR,"Neighbor list overflow, boost neigh_modify one");
|
if (ipage->status()) error->one(FLERR, "Neighbor list overflow, boost neigh_modify one");
|
||||||
|
|
||||||
ilist_inner[inum] = i;
|
ilist_inner[inum] = i;
|
||||||
firstneigh_inner[i] = neighptr_inner;
|
firstneigh_inner[i] = neighptr_inner;
|
||||||
numneigh_inner[i] = n_inner;
|
numneigh_inner[i] = n_inner;
|
||||||
ipage_inner->vgot(n);
|
ipage_inner->vgot(n);
|
||||||
if (ipage_inner->status()) error->one(FLERR,"Neighbor list overflow, boost neigh_modify one");
|
if (ipage_inner->status()) error->one(FLERR, "Neighbor list overflow, boost neigh_modify one");
|
||||||
|
|
||||||
if (respamiddle) {
|
if (respamiddle) {
|
||||||
ilist_middle[inum] = i;
|
ilist_middle[inum] = i;
|
||||||
firstneigh_middle[i] = neighptr_middle;
|
firstneigh_middle[i] = neighptr_middle;
|
||||||
numneigh_middle[i] = n_middle;
|
numneigh_middle[i] = n_middle;
|
||||||
ipage_middle->vgot(n);
|
ipage_middle->vgot(n);
|
||||||
if (ipage_middle->status()) error->one(FLERR,"Neighbor list overflow, boost neigh_modify one");
|
if (ipage_middle->status()) error->one(FLERR, "Neighbor list overflow, boost neigh_modify one");
|
||||||
}
|
}
|
||||||
|
|
||||||
inum++;
|
inum++;
|
||||||
|
|||||||
@ -107,7 +107,7 @@ void NPairSkipSizeOff2onOneside::build(NeighList *list)
|
|||||||
for (i = 0; i < nlocal; i++) {
|
for (i = 0; i < nlocal; i++) {
|
||||||
if (numneigh[i] == 0) continue;
|
if (numneigh[i] == 0) continue;
|
||||||
firstneigh[i] = ipage->get(numneigh[i]);
|
firstneigh[i] = ipage->get(numneigh[i]);
|
||||||
if (ipage->status()) error->one(FLERR,"Neighbor list overflow, boost neigh_modify one");
|
if (ipage->status()) error->one(FLERR, "Neighbor list overflow, boost neigh_modify one");
|
||||||
}
|
}
|
||||||
|
|
||||||
// second loop over atoms in other list to store neighbors
|
// second loop over atoms in other list to store neighbors
|
||||||
|
|||||||
Reference in New Issue
Block a user