changing order of central bin

This commit is contained in:
jtclemm
2022-09-03 16:46:55 -06:00
parent fb2cf0c32a
commit 25b89473b2

View File

@ -39,15 +39,20 @@ void NStencilBin<HALF, DIM_3D, TRI>::create()
nstencil = 0;
// Half and ortho stencils include central bin first
// This preserves the historical order of the neighbor list
// as the old npair classes used to separately parse the central bin first
if (HALF && (!TRI)) stencil[nstencil++] = 0;
for (k = -sz_min; k <= sz; k++) {
for (j = -sy_min; j <= sy; j++) {
for (i = -sx; i <= sx; i++) {
// Half and ortho stencils only include own and "upper right" bins
// Now only include "upper right" bins for half and ortho stencils
if (HALF && (!DIM_3D) && (!TRI))
if (! (j > 0 || (j == 0 && i >= 0))) continue;
if (! (j > 0 || (j == 0 && i > 0))) continue;
if (HALF && DIM_3D && (!TRI))
if (! (k > 0 || j > 0 || (j == 0 && i >= 0))) continue;
if (! (k > 0 || j > 0 || (j == 0 && i > 0))) continue;
if (bin_distance(i,j,k) < cutneighmaxsq)
stencil[nstencil++] = k*mbiny*mbinx + j*mbinx + i;