git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@13135 f3b2605a-c512-4ea7-a41b-209d697bcdaa

This commit is contained in:
pscrozi
2015-02-19 23:38:45 +00:00
parent 30d3b91ec0
commit 4e8c2824e3
3 changed files with 33 additions and 21 deletions

View File

@ -607,6 +607,17 @@ void PPPM::compute(int eflag, int vflag)
cg_peratom->setup();
}
// if atom count has changed, update qsum and qsqsum
if (atom->natoms != natoms_original) {
qsum_qsq();
natoms_original = atom->natoms;
}
// return if there are no charges
if (qsqsum == 0.0) return;
// convert atoms from box to lamda coords
if (triclinic == 0) boxlo = domain->boxlo;
@ -666,13 +677,6 @@ void PPPM::compute(int eflag, int vflag)
if (evflag_atom) fieldforce_peratom();
// update qsum and qsqsum, if atom count has changed and energy needed
if ((eflag_global || eflag_atom) && atom->natoms != natoms_original) {
qsum_qsq();
natoms_original = atom->natoms;
}
// sum global energy across procs and add in volume-dependent term
const double qscale = qqrd2e * scale;