From 4a09399dc64ccb802e91ca3cc893b660d85a233d Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer <akohlmey@gmail.com> Date: Sat, 14 Jan 2017 17:13:22 -0500 Subject: [PATCH] during setup, checking timestep doesn't seem to be sufficient. comparing bins and stencil point, too. in addition, relevant pointers were not properly initialized to NULL --- src/npair.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/npair.cpp b/src/npair.cpp index 6ea4e62550..7f5956d040 100644 --- a/src/npair.cpp +++ b/src/npair.cpp @@ -24,7 +24,8 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ -NPair::NPair(LAMMPS *lmp) : Pointers(lmp) +NPair::NPair(LAMMPS *lmp) + : Pointers(lmp), nb(NULL), ns(NULL), bins(NULL), stencil(NULL) { last_build = -1; last_copy_bin_setup = last_copy_bin = last_copy_stencil = -1; @@ -130,11 +131,11 @@ void NPair::build_setup() copy_bin_setup_info(); last_copy_bin_setup = update->ntimestep; } - if (nb && last_copy_bin < nb->last_bin_memory) { + if (nb && ((last_copy_bin < nb->last_bin_memory) || (bins != nb->bins))) { copy_bin_info(); last_copy_bin = update->ntimestep; } - if (ns && last_copy_stencil < ns->last_create) { + if (ns && ((last_copy_stencil < ns->last_create) || (stencil != ns->stencil))) { copy_stencil_info(); last_copy_stencil = update->ntimestep; } -- GitLab