git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@7782 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
@ -22,6 +22,7 @@
|
||||
#include "angle.h"
|
||||
#include "dihedral.h"
|
||||
#include "improper.h"
|
||||
#include "kspace.h"
|
||||
#include "memory.h"
|
||||
#include "error.h"
|
||||
|
||||
@ -43,9 +44,11 @@ ComputePEAtom::ComputePEAtom(LAMMPS *lmp, int narg, char **arg) :
|
||||
if (narg == 3) {
|
||||
pairflag = 1;
|
||||
bondflag = angleflag = dihedralflag = improperflag = 1;
|
||||
kspaceflag = 1;
|
||||
} else {
|
||||
pairflag = 0;
|
||||
bondflag = angleflag = dihedralflag = improperflag = 0;
|
||||
kspaceflag = 0;
|
||||
int iarg = 3;
|
||||
while (iarg < narg) {
|
||||
if (strcmp(arg[iarg],"pair") == 0) pairflag = 1;
|
||||
@ -53,6 +56,7 @@ ComputePEAtom::ComputePEAtom(LAMMPS *lmp, int narg, char **arg) :
|
||||
else if (strcmp(arg[iarg],"angle") == 0) angleflag = 1;
|
||||
else if (strcmp(arg[iarg],"dihedral") == 0) dihedralflag = 1;
|
||||
else if (strcmp(arg[iarg],"improper") == 0) improperflag = 1;
|
||||
else if (strcmp(arg[iarg],"kspace") == 0) kspaceflag = 1;
|
||||
else error->all(FLERR,"Illegal compute pe/atom command");
|
||||
iarg++;
|
||||
}
|
||||
@ -137,6 +141,13 @@ void ComputePEAtom::compute_peratom()
|
||||
|
||||
if (force->newton) comm->reverse_comm_compute(this);
|
||||
|
||||
// KSpace contribution is already per local atom
|
||||
|
||||
if (kspaceflag && force->kspace) {
|
||||
double *eatom = force->kspace->eatom;
|
||||
for (i = 0; i < nlocal; i++) energy[i] += eatom[i];
|
||||
}
|
||||
|
||||
// zero energy of atoms not in group
|
||||
// only do this after comm since ghost contributions must be included
|
||||
|
||||
|
||||
Reference in New Issue
Block a user