git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@7794 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
@ -216,7 +216,8 @@ void Ewald::compute(int eflag, int vflag)
|
|||||||
// set energy/virial flags
|
// set energy/virial flags
|
||||||
|
|
||||||
if (eflag || vflag) ev_setup(eflag,vflag);
|
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
|
// 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][1] += partial*eg[k][1];
|
||||||
ek[i][2] += partial*eg[k][2];
|
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];
|
partial_peratom = exprl*sfacrl_all[k] + expim*sfacim_all[k];
|
||||||
if (eflag_atom) eatom[i] += q[i]*ug[k]*partial_peratom;
|
if (eflag_atom) eatom[i] += q[i]*ug[k]*partial_peratom;
|
||||||
if (vflag_atom)
|
if (vflag_atom)
|
||||||
@ -315,7 +316,7 @@ void Ewald::compute(int eflag, int vflag)
|
|||||||
// per-atom energy/virial
|
// per-atom energy/virial
|
||||||
// energy includes self-energy correction
|
// energy includes self-energy correction
|
||||||
|
|
||||||
if (eflag_atom || vflag_atom) {
|
if (evflag_atom) {
|
||||||
if (eflag_atom) {
|
if (eflag_atom) {
|
||||||
for (i = 0; i < nlocal; i++) {
|
for (i = 0; i < nlocal; i++) {
|
||||||
eatom[i] -= g_ewald*q[i]*q[i]/MY_PIS + MY_PI2*q[i]*qsum /
|
eatom[i] -= g_ewald*q[i]*q[i]/MY_PIS + MY_PI2*q[i]*qsum /
|
||||||
|
|||||||
@ -680,9 +680,10 @@ void PPPM::compute(int eflag, int vflag)
|
|||||||
// invoke allocate_peratom() if needed for first time
|
// invoke allocate_peratom() if needed for first time
|
||||||
|
|
||||||
if (eflag || vflag) ev_setup(eflag,vflag);
|
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();
|
allocate_peratom();
|
||||||
peratom_allocate_flag = 1;
|
peratom_allocate_flag = 1;
|
||||||
}
|
}
|
||||||
@ -729,7 +730,7 @@ void PPPM::compute(int eflag, int vflag)
|
|||||||
|
|
||||||
// extra per-atom energy/virial communication
|
// extra per-atom energy/virial communication
|
||||||
|
|
||||||
if (eflag_atom || vflag_atom) fillbrick_peratom();
|
if (evflag_atom) fillbrick_peratom();
|
||||||
|
|
||||||
// calculate the force on my particles
|
// calculate the force on my particles
|
||||||
|
|
||||||
@ -737,7 +738,7 @@ void PPPM::compute(int eflag, int vflag)
|
|||||||
|
|
||||||
// extra per-atom energy/virial communication
|
// 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
|
// 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
|
// per-atom energy/virial
|
||||||
// energy includes self-energy correction
|
// energy includes self-energy correction
|
||||||
|
|
||||||
if (eflag_atom || vflag_atom) {
|
if (evflag_atom) {
|
||||||
double *q = atom->q;
|
double *q = atom->q;
|
||||||
int nlocal = atom->nlocal;
|
int nlocal = atom->nlocal;
|
||||||
|
|
||||||
@ -1962,7 +1963,7 @@ void PPPM::poisson()
|
|||||||
|
|
||||||
// extra FFTs for per-atom energy/virial
|
// 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)
|
// compute gradients of V(r) in each of 3 dims by transformimg -ik*V(k)
|
||||||
// FFT leaves data in 3d brick decomposition
|
// FFT leaves data in 3d brick decomposition
|
||||||
|
|||||||
@ -77,9 +77,10 @@ void PPPMCG::compute(int eflag, int vflag)
|
|||||||
// invoke allocate_peratom() if needed for first time
|
// invoke allocate_peratom() if needed for first time
|
||||||
|
|
||||||
if (eflag || vflag) ev_setup(eflag,vflag);
|
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();
|
allocate_peratom();
|
||||||
peratom_allocate_flag = 1;
|
peratom_allocate_flag = 1;
|
||||||
}
|
}
|
||||||
@ -179,7 +180,7 @@ void PPPMCG::compute(int eflag, int vflag)
|
|||||||
|
|
||||||
// extra per-atom energy/virial communication
|
// extra per-atom energy/virial communication
|
||||||
|
|
||||||
if (eflag_atom || vflag_atom) fillbrick_peratom();
|
if (evflag_atom) fillbrick_peratom();
|
||||||
|
|
||||||
// calculate the force on my particles
|
// calculate the force on my particles
|
||||||
|
|
||||||
@ -187,7 +188,7 @@ void PPPMCG::compute(int eflag, int vflag)
|
|||||||
|
|
||||||
// extra per-atom energy/virial communication
|
// 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
|
// 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
|
// per-atom energy/virial
|
||||||
// energy includes self-energy correction
|
// energy includes self-energy correction
|
||||||
|
|
||||||
if (eflag_atom || vflag_atom) {
|
if (evflag_atom) {
|
||||||
double *q = atom->q;
|
double *q = atom->q;
|
||||||
int nlocal = atom->nlocal;
|
int nlocal = atom->nlocal;
|
||||||
|
|
||||||
|
|||||||
@ -46,7 +46,7 @@ class KSpace : protected Pointers {
|
|||||||
double scale;
|
double scale;
|
||||||
double slab_volfactor;
|
double slab_volfactor;
|
||||||
|
|
||||||
int evflag;
|
int evflag,evflag_atom;
|
||||||
int eflag_either,eflag_global,eflag_atom;
|
int eflag_either,eflag_global,eflag_atom;
|
||||||
int vflag_either,vflag_global,vflag_atom;
|
int vflag_either,vflag_global,vflag_atom;
|
||||||
int maxeatom,maxvatom;
|
int maxeatom,maxvatom;
|
||||||
|
|||||||
Reference in New Issue
Block a user