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
This commit is contained in:
Axel Kohlmeyer
2017-01-14 17:13:22 -05:00
parent 5821fe8dd5
commit 4a09399dc6

View File

@ -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;
}