forked from lijiext/lammps
git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@13135 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
parent
30d3b91ec0
commit
4e8c2824e3
|
@ -354,7 +354,18 @@ void Ewald::compute(int eflag, int vflag)
|
||||||
if (eflag || vflag) ev_setup(eflag,vflag);
|
if (eflag || vflag) ev_setup(eflag,vflag);
|
||||||
else evflag = evflag_atom = eflag_global = vflag_global =
|
else evflag = evflag_atom = eflag_global = vflag_global =
|
||||||
eflag_atom = vflag_atom = 0;
|
eflag_atom = vflag_atom = 0;
|
||||||
|
|
||||||
|
// 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;
|
||||||
|
|
||||||
// extend size of per-atom arrays if necessary
|
// extend size of per-atom arrays if necessary
|
||||||
|
|
||||||
if (atom->nlocal > nmax) {
|
if (atom->nlocal > nmax) {
|
||||||
|
@ -431,13 +442,6 @@ void Ewald::compute(int eflag, int vflag)
|
||||||
if (slabflag != 2) f[i][2] += qscale * q[i]*ek[i][2];
|
if (slabflag != 2) f[i][2] += qscale * q[i]*ek[i][2];
|
||||||
}
|
}
|
||||||
|
|
||||||
// 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 Kspace vevs and add in volume-dependent term
|
// sum global energy across Kspace vevs and add in volume-dependent term
|
||||||
|
|
||||||
if (eflag_global) {
|
if (eflag_global) {
|
||||||
|
|
|
@ -457,6 +457,17 @@ void MSM::compute(int eflag, int vflag)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 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;
|
||||||
|
|
||||||
// invoke allocate_peratom() if needed for first time
|
// invoke allocate_peratom() if needed for first time
|
||||||
|
|
||||||
if (vflag_atom && !peratom_allocate_flag) {
|
if (vflag_atom && !peratom_allocate_flag) {
|
||||||
|
@ -565,13 +576,6 @@ void MSM::compute(int eflag, int vflag)
|
||||||
|
|
||||||
if (evflag_atom) fieldforce_peratom();
|
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 self-energy term
|
// sum global energy across procs and add in self-energy term
|
||||||
|
|
||||||
const double qscale = qqrd2e * scale;
|
const double qscale = qqrd2e * scale;
|
||||||
|
|
|
@ -607,6 +607,17 @@ void PPPM::compute(int eflag, int vflag)
|
||||||
cg_peratom->setup();
|
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
|
// convert atoms from box to lamda coords
|
||||||
|
|
||||||
if (triclinic == 0) boxlo = domain->boxlo;
|
if (triclinic == 0) boxlo = domain->boxlo;
|
||||||
|
@ -666,13 +677,6 @@ void PPPM::compute(int eflag, int vflag)
|
||||||
|
|
||||||
if (evflag_atom) fieldforce_peratom();
|
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
|
// sum global energy across procs and add in volume-dependent term
|
||||||
|
|
||||||
const double qscale = qqrd2e * scale;
|
const double qscale = qqrd2e * scale;
|
||||||
|
|
Loading…
Reference in New Issue