correct bug in tracking atom->nlocal vs. atom->nmax when allocating pbc enforcement buffers

(cherry picked from commit 45a2dd36d0)
This commit is contained in:
Axel Kohlmeyer 2016-08-21 11:18:02 -04:00
parent 1383684048
commit 5909bd5429
1 changed files with 2 additions and 2 deletions

View File

@ -276,7 +276,7 @@ void Dump::init()
// preallocation for PBC copies if requested
if (pbcflag && atom->nlocal > maxpbc) pbc_allocate();
if (pbcflag && atom->nmax > maxpbc) pbc_allocate();
}
/* ---------------------------------------------------------------------- */
@ -374,7 +374,7 @@ void Dump::write()
if (pbcflag) {
int nlocal = atom->nlocal;
if (nlocal > maxpbc) pbc_allocate();
if (atom->nmax > maxpbc) pbc_allocate();
if (nlocal) {
memcpy(&xpbc[0][0],&atom->x[0][0],3*nlocal*sizeof(double));
memcpy(&vpbc[0][0],&atom->v[0][0],3*nlocal*sizeof(double));