From 14dd64b17a9c23cfb66805d0c194d76d5f3e869d Mon Sep 17 00:00:00 2001 From: sjplimp Date: Wed, 15 Feb 2012 15:12:49 +0000 Subject: [PATCH] git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@7794 f3b2605a-c512-4ea7-a41b-209d697bcdaa --- src/KSPACE/ewald.cpp | 7 ++++--- src/KSPACE/pppm.cpp | 13 +++++++------ src/KSPACE/pppm_cg.cpp | 11 ++++++----- src/kspace.h | 2 +- 4 files changed, 18 insertions(+), 15 deletions(-) diff --git a/src/KSPACE/ewald.cpp b/src/KSPACE/ewald.cpp index 6e9e64fc51..731509970a 100644 --- a/src/KSPACE/ewald.cpp +++ b/src/KSPACE/ewald.cpp @@ -216,7 +216,8 @@ void Ewald::compute(int eflag, int vflag) // set energy/virial flags if (eflag || vflag) ev_setup(eflag,vflag); - else evflag = eflag_global = vflag_global = eflag_atom = vflag_atom = 0; + else evflag = evflag_atom = eflag_global = vflag_global = + eflag_atom = vflag_atom = 0; // extend size of per-atom arrays if necessary @@ -270,7 +271,7 @@ void Ewald::compute(int eflag, int vflag) ek[i][1] += partial*eg[k][1]; ek[i][2] += partial*eg[k][2]; - if (eflag_atom || vflag_atom) { + if (evflag_atom) { partial_peratom = exprl*sfacrl_all[k] + expim*sfacim_all[k]; if (eflag_atom) eatom[i] += q[i]*ug[k]*partial_peratom; if (vflag_atom) @@ -315,7 +316,7 @@ void Ewald::compute(int eflag, int vflag) // per-atom energy/virial // energy includes self-energy correction - if (eflag_atom || vflag_atom) { + if (evflag_atom) { if (eflag_atom) { for (i = 0; i < nlocal; i++) { eatom[i] -= g_ewald*q[i]*q[i]/MY_PIS + MY_PI2*q[i]*qsum / diff --git a/src/KSPACE/pppm.cpp b/src/KSPACE/pppm.cpp index 3541dee790..8cd30a76e1 100644 --- a/src/KSPACE/pppm.cpp +++ b/src/KSPACE/pppm.cpp @@ -680,9 +680,10 @@ void PPPM::compute(int eflag, int vflag) // invoke allocate_peratom() if needed for first time if (eflag || vflag) ev_setup(eflag,vflag); - else evflag = eflag_global = vflag_global = eflag_atom = vflag_atom = 0; + else evflag = evflag_atom = eflag_global = vflag_global = + eflag_atom = vflag_atom = 0; - if (!peratom_allocate_flag && (eflag_atom || vflag_atom)) { + if (evflag_atom && !peratom_allocate_flag) { allocate_peratom(); peratom_allocate_flag = 1; } @@ -729,7 +730,7 @@ void PPPM::compute(int eflag, int vflag) // extra per-atom energy/virial communication - if (eflag_atom || vflag_atom) fillbrick_peratom(); + if (evflag_atom) fillbrick_peratom(); // calculate the force on my particles @@ -737,7 +738,7 @@ void PPPM::compute(int eflag, int vflag) // extra per-atom energy/virial communication - if (eflag_atom || vflag_atom) fieldforce_peratom(); + if (evflag_atom) fieldforce_peratom(); // sum global energy across procs and add in volume-dependent term @@ -765,7 +766,7 @@ void PPPM::compute(int eflag, int vflag) // per-atom energy/virial // energy includes self-energy correction - if (eflag_atom || vflag_atom) { + if (evflag_atom) { double *q = atom->q; int nlocal = atom->nlocal; @@ -1962,7 +1963,7 @@ void PPPM::poisson() // extra FFTs for per-atom energy/virial - if (eflag_atom || vflag_atom) poisson_peratom(); + if (evflag_atom) poisson_peratom(); // compute gradients of V(r) in each of 3 dims by transformimg -ik*V(k) // FFT leaves data in 3d brick decomposition diff --git a/src/KSPACE/pppm_cg.cpp b/src/KSPACE/pppm_cg.cpp index 9dff8c2db4..dd6396fe38 100644 --- a/src/KSPACE/pppm_cg.cpp +++ b/src/KSPACE/pppm_cg.cpp @@ -77,9 +77,10 @@ void PPPMCG::compute(int eflag, int vflag) // invoke allocate_peratom() if needed for first time if (eflag || vflag) ev_setup(eflag,vflag); - else evflag = eflag_global = vflag_global = eflag_atom = vflag_atom = 0; + else evflag = evflag_atom = eflag_global = vflag_global = + eflag_atom = vflag_atom = 0; - if (!peratom_allocate_flag && (eflag_atom || vflag_atom)) { + if (evflag_atom && !peratom_allocate_flag) { allocate_peratom(); peratom_allocate_flag = 1; } @@ -179,7 +180,7 @@ void PPPMCG::compute(int eflag, int vflag) // extra per-atom energy/virial communication - if (eflag_atom || vflag_atom) fillbrick_peratom(); + if (evflag_atom) fillbrick_peratom(); // calculate the force on my particles @@ -187,7 +188,7 @@ void PPPMCG::compute(int eflag, int vflag) // extra per-atom energy/virial communication - if (eflag_atom || vflag_atom) fieldforce_peratom(); + if (evflag_atom) fieldforce_peratom(); // sum global energy across procs and add in volume-dependent term @@ -215,7 +216,7 @@ void PPPMCG::compute(int eflag, int vflag) // per-atom energy/virial // energy includes self-energy correction - if (eflag_atom || vflag_atom) { + if (evflag_atom) { double *q = atom->q; int nlocal = atom->nlocal; diff --git a/src/kspace.h b/src/kspace.h index 32aa939cbd..83333da746 100644 --- a/src/kspace.h +++ b/src/kspace.h @@ -46,7 +46,7 @@ class KSpace : protected Pointers { double scale; double slab_volfactor; - int evflag; + int evflag,evflag_atom; int eflag_either,eflag_global,eflag_atom; int vflag_either,vflag_global,vflag_atom; int maxeatom,maxvatom;