From 56841ba9123635e2da4302f4afb8ee7390231d39 Mon Sep 17 00:00:00 2001 From: Joel Clemmer Date: Tue, 2 Feb 2021 18:05:19 -0700 Subject: [PATCH] Fixing typo in pair gran, fixing bugs in communication and neighbor --- src/GRANULAR/pair_granular.cpp | 6 +++--- src/comm.cpp | 7 +++++++ src/neighbor.cpp | 2 +- src/nstencil.cpp | 1 + 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/GRANULAR/pair_granular.cpp b/src/GRANULAR/pair_granular.cpp index 0f1fbd49f3..e9da16c760 100644 --- a/src/GRANULAR/pair_granular.cpp +++ b/src/GRANULAR/pair_granular.cpp @@ -1831,9 +1831,9 @@ double PairGranular::atom2cut(int i) cut = atom->radius[i]*2; if(beyond_contact) { - int itype = atom->type[i] + int itype = atom->type[i]; if(normal_model[itype][itype] == JKR) { - cut += pulloffdistance(cut, cut, itype, itype); + cut += pulloff_distance(cut, cut, itype, itype); } } @@ -1856,7 +1856,7 @@ double PairGranular::radii2cut(double r1, double r2) for(int i = 0; i < n; i++){ for(int j = 0; j < n; j++){ if(normal_model[i][j] == JKR) { - temp = pulloffdistance(r1, r2, i, j); + temp = pulloff_distance(r1, r2, i, j); if(temp > cut) cut = temp; } } diff --git a/src/comm.cpp b/src/comm.cpp index c84f0249ef..33e4b894d5 100644 --- a/src/comm.cpp +++ b/src/comm.cpp @@ -735,6 +735,13 @@ double Comm::get_comm_cutoff() maxcommcutoff)); } + // Check maximum interval size for neighbor multi + if(neighbor->interval_collection_flag){ + for(int i = 0; i < neighbor->ncollections; i++){ + maxcommcutoff = MAX(maxcommcutoff, neighbor->collection2cut[i]); + } + } + return maxcommcutoff; } diff --git a/src/neighbor.cpp b/src/neighbor.cpp index 16aca434f1..2671553a07 100644 --- a/src/neighbor.cpp +++ b/src/neighbor.cpp @@ -2655,7 +2655,7 @@ void Neighbor::build_collection(int istart) collection[i] = -1; for(icollection = 0; icollection < ncollections; icollection++){ - if(collection2cut[icollection] > cut) { + if(collection2cut[icollection] >= cut) { collection[i] = icollection; break; } diff --git a/src/nstencil.cpp b/src/nstencil.cpp index c6ed76b6eb..ca8c3156e3 100644 --- a/src/nstencil.cpp +++ b/src/nstencil.cpp @@ -354,6 +354,7 @@ void NStencil::create_setup() if (sy*binsizey_multi[bin_collection] < stencil_range) sy++; sz = static_cast (stencil_range*bininvz_multi[bin_collection]); if (sz*binsizez_multi[bin_collection] < stencil_range) sz++; + if (dimension == 2) sz = 0; stencil_sx_multi[i][j] = sx; stencil_sy_multi[i][j] = sy;