From 45a2dd36d0f0643d86344de44e2c260fba2e2e77 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sun, 21 Aug 2016 11:18:02 -0400 Subject: [PATCH] correct bug in tracking atom->nlocal vs. atom->nmax when allocating pbc enforcement buffers --- src/dump.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dump.cpp b/src/dump.cpp index 3198429519..511abdaa87 100644 --- a/src/dump.cpp +++ b/src/dump.cpp @@ -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));