diff --git a/src/GRANULAR/fix_pour.cpp b/src/GRANULAR/fix_pour.cpp index 2aadb57e10..55c97adb09 100644 --- a/src/GRANULAR/fix_pour.cpp +++ b/src/GRANULAR/fix_pour.cpp @@ -470,7 +470,8 @@ void FixPour::pre_exchange() // set tag # of new particles beyond all previous atoms // reset global natoms - // if global map exists, reset it + // if global map exists, reset it now instead of waiting for comm + // since deleting atoms messes up ghosts if (atom->tag_enable) { atom->tag_extend(); diff --git a/src/KSPACE/ewald.cpp b/src/KSPACE/ewald.cpp index 46e15d07d6..423db9e765 100644 --- a/src/KSPACE/ewald.cpp +++ b/src/KSPACE/ewald.cpp @@ -214,10 +214,9 @@ void Ewald::compute(int eflag, int vflag) energy = 0.0; if (vflag) for (n = 0; n < 6; n++) virial[n] = 0.0; - // extend size of nlocal-dependent arrays if necessary + // extend size of per-atom arrays if necessary - int nlocal = atom->nlocal; - if (nlocal > nmax) { + if (atom->nlocal > nmax) { memory->destroy_2d_double_array(ek); memory->destroy_3d_double_array(cs,-kmax_created); memory->destroy_3d_double_array(sn,-kmax_created); @@ -240,6 +239,7 @@ void Ewald::compute(int eflag, int vflag) double **f = atom->f; double *q = atom->q; + int nlocal = atom->nlocal; int kx,ky,kz; double cypz,sypz,exprl,expim,partial; diff --git a/src/KSPACE/pppm.cpp b/src/KSPACE/pppm.cpp index ec5716317f..d31ab74f9c 100644 --- a/src/KSPACE/pppm.cpp +++ b/src/KSPACE/pppm.cpp @@ -646,7 +646,7 @@ void PPPM::compute(int eflag, int vflag) domain->x2lamda(atom->nlocal); } - // extend size of nlocal-dependent arrays if necessary + // extend size of per-atom arrays if necessary if (atom->nlocal > nmax) { memory->destroy_2d_int_array(part2grid); diff --git a/src/MANYBODY/pair_eam.cpp b/src/MANYBODY/pair_eam.cpp index b12b922baf..095928df90 100644 --- a/src/MANYBODY/pair_eam.cpp +++ b/src/MANYBODY/pair_eam.cpp @@ -134,7 +134,8 @@ void PairEAM::compute(int eflag, int vflag) if (eflag || vflag) ev_setup(eflag,vflag); else evflag = vflag_fdotr = 0; - // grow energy array if necessary + // grow energy and fp arrays if necessary + // need to be atom->nmax in length if (atom->nmax > nmax) { memory->sfree(rho); diff --git a/src/MOLECULE/fix_bond_break.cpp b/src/MOLECULE/fix_bond_break.cpp index 7f828cb141..62f93e1ed9 100755 --- a/src/MOLECULE/fix_bond_break.cpp +++ b/src/MOLECULE/fix_bond_break.cpp @@ -167,6 +167,7 @@ void FixBondBreak::post_integrate() // resize bond partner list and initialize it // probability array overlays distsq array + // needs to be atom->nmax in length if (atom->nmax > nmax) { memory->sfree(partner); diff --git a/src/MOLECULE/fix_bond_create.cpp b/src/MOLECULE/fix_bond_create.cpp index e50a81faf4..f7ea34c3aa 100755 --- a/src/MOLECULE/fix_bond_create.cpp +++ b/src/MOLECULE/fix_bond_create.cpp @@ -278,6 +278,7 @@ void FixBondCreate::post_integrate() // resize bond partner list and initialize it // probability array overlays distsq array + // needs to be atom->nmax in length if (atom->nmax > nmax) { memory->sfree(partner); diff --git a/src/PERI/pair_peri_pmb.cpp b/src/PERI/pair_peri_pmb.cpp index 8a801ba27e..0ba483e60d 100644 --- a/src/PERI/pair_peri_pmb.cpp +++ b/src/PERI/pair_peri_pmb.cpp @@ -183,9 +183,9 @@ void PairPeriPMB::compute(int eflag, int vflag) } } - // bond forces + // grow bond forces array if necessary - if (atom->nmax > nmax) { + if (nlocal > nmax) { memory->sfree(s0_new); nmax = atom->nmax; s0_new = (double *) memory->smalloc(nmax*sizeof(double),"pair:s0_new"); diff --git a/src/fix_box_relax.cpp b/src/fix_box_relax.cpp index 871f609697..9d8bc4b380 100644 --- a/src/fix_box_relax.cpp +++ b/src/fix_box_relax.cpp @@ -269,8 +269,6 @@ double FixBoxRelax::min_energy(double *fextra) // returned eng = PV must be in units of energy // returned fextra must likewise be in units of energy - fextra[0] = fextra[1] = fextra[2] = 0.0; - if (press_couple == XYZ) { scale = domain->xprd/xprdinit; if (dimension == 3) { @@ -282,6 +280,7 @@ double FixBoxRelax::min_energy(double *fextra) } } else { + fextra[0] = fextra[1] = fextra[2] = 0.0; scalex = scaley = scalez = 1.0; if (p_flag[0]) scalex = domain->xprd/xprdinit; if (p_flag[1]) scaley = domain->yprd/yprdinit;