From 8a35ea05bcb1b2096f047c44a47a2dc7dbe0ea6a Mon Sep 17 00:00:00 2001 From: Stan Gerald Moore Date: Tue, 28 Sep 2021 15:33:44 -0600 Subject: [PATCH] Prevent neigh list from copying "unique" stencil/bin --- src/neighbor.cpp | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/src/neighbor.cpp b/src/neighbor.cpp index d58823063c..64691c5048 100644 --- a/src/neighbor.cpp +++ b/src/neighbor.cpp @@ -915,11 +915,14 @@ int Neighbor::init_pair() requests[i]->index_bin = -1; flag = lists[i]->bin_method; if (flag == 0) continue; - for (j = 0; j < nbin; j++) - if (neigh_bin[j]->istyle == flag) break; - if (j < nbin && !requests[i]->unique) { - requests[i]->index_bin = j; - continue; + if (!requests[i]->unique) { + for (j = 0; j < nbin; j++) + if (neigh_bin[j]->istyle == flag && + neigh_bin[j]->cutoff_custom == 0.0) break; + if (j < nbin) { + requests[i]->index_bin = j; + continue; + } } BinCreator &bin_creator = binclass[flag-1]; @@ -936,11 +939,14 @@ int Neighbor::init_pair() requests[i]->index_stencil = -1; flag = lists[i]->stencil_method; if (flag == 0) continue; - for (j = 0; j < nstencil; j++) - if (neigh_stencil[j]->istyle == flag) break; - if (j < nstencil && !requests[i]->unique) { - requests[i]->index_stencil = j; - continue; + if (!requests[i]->unique) { + for (j = 0; j < nstencil; j++) + if (neigh_stencil[j]->istyle == flag && + neigh_stencil[j]->cutoff_custom == 0.0) break; + if (j < nstencil) { + requests[i]->index_stencil = j; + continue; + } } StencilCreator &stencil_creator = stencilclass[flag-1];