From 0008c0eca33932ff5d75fb09ef1045467809ba9f Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sun, 19 Jul 2020 12:12:20 -0400 Subject: [PATCH] need to setup bins again if binning style has be reset --- src/nbin.cpp | 4 +++- src/neighbor.cpp | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/nbin.cpp b/src/nbin.cpp index 4838d1d63d..1092311f6a 100644 --- a/src/nbin.cpp +++ b/src/nbin.cpp @@ -26,11 +26,13 @@ using namespace LAMMPS_NS; NBin::NBin(LAMMPS *lmp) : Pointers(lmp) { last_bin = -1; - maxbin = maxatom = 0; + mbins = maxbin = maxatom = 0; binhead = NULL; bins = NULL; atom2bin = NULL; + neighbor->last_setup_bins = -1; + // geometry settings dimension = domain->dimension; diff --git a/src/neighbor.cpp b/src/neighbor.cpp index 326166d011..70333461ba 100644 --- a/src/neighbor.cpp +++ b/src/neighbor.cpp @@ -2078,6 +2078,7 @@ void Neighbor::build(int topoflag) // leading to errors or even a crash if (style != Neighbor::NSQ) { + if (last_setup_bins < 0) setup_bins(); for (int i = 0; i < nbin; i++) { neigh_bin[i]->bin_atoms_setup(nall); neigh_bin[i]->bin_atoms();