forked from lijiext/lammps
git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@7873 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
parent
c6dae6c514
commit
3fb19bcea6
|
@ -90,6 +90,7 @@ void PairLJCutCoulLongTIP4P::compute(int eflag, int vflag)
|
||||||
double *special_lj = force->special_lj;
|
double *special_lj = force->special_lj;
|
||||||
int newton_pair = force->newton_pair;
|
int newton_pair = force->newton_pair;
|
||||||
double qqrd2e = force->qqrd2e;
|
double qqrd2e = force->qqrd2e;
|
||||||
|
double cut_coulsqplus = (cut_coul+2.0*qdist) * (cut_coul+2.0*qdist);
|
||||||
|
|
||||||
inum = list->inum;
|
inum = list->inum;
|
||||||
ilist = list->ilist;
|
ilist = list->ilist;
|
||||||
|
@ -124,7 +125,7 @@ void PairLJCutCoulLongTIP4P::compute(int eflag, int vflag)
|
||||||
rsq = delx*delx + dely*dely + delz*delz;
|
rsq = delx*delx + dely*dely + delz*delz;
|
||||||
jtype = type[j];
|
jtype = type[j];
|
||||||
|
|
||||||
// LJ interation based on true rsq
|
// LJ interaction based on true rsq
|
||||||
|
|
||||||
if (rsq < cut_ljsq[itype][jtype]) {
|
if (rsq < cut_ljsq[itype][jtype]) {
|
||||||
r2inv = 1.0/rsq;
|
r2inv = 1.0/rsq;
|
||||||
|
@ -150,209 +151,213 @@ void PairLJCutCoulLongTIP4P::compute(int eflag, int vflag)
|
||||||
}
|
}
|
||||||
|
|
||||||
// adjust rsq and delxyz for off-site O charge(s) if necessary
|
// adjust rsq and delxyz for off-site O charge(s) if necessary
|
||||||
|
// but only if they are within reach
|
||||||
|
|
||||||
if (itype == typeO || jtype == typeO) {
|
if (rsq < cut_coulsqplus) {
|
||||||
if (jtype == typeO) {
|
|
||||||
find_M(j,jH1,jH2,xjM);
|
|
||||||
x2 = xjM;
|
|
||||||
} else x2 = x[j];
|
|
||||||
delx = x1[0] - x2[0];
|
|
||||||
dely = x1[1] - x2[1];
|
|
||||||
delz = x1[2] - x2[2];
|
|
||||||
rsq = delx*delx + dely*dely + delz*delz;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Coulombic interaction based on modified rsq
|
if (itype == typeO || jtype == typeO) {
|
||||||
|
if (jtype == typeO) {
|
||||||
if (rsq < cut_coulsq) {
|
find_M(j,jH1,jH2,xjM);
|
||||||
r2inv = 1 / rsq;
|
x2 = xjM;
|
||||||
if (!ncoultablebits || rsq <= tabinnersq) {
|
} else x2 = x[j];
|
||||||
r = sqrt(rsq);
|
delx = x1[0] - x2[0];
|
||||||
grij = g_ewald * r;
|
dely = x1[1] - x2[1];
|
||||||
expm2 = exp(-grij*grij);
|
delz = x1[2] - x2[2];
|
||||||
t = 1.0 / (1.0 + EWALD_P*grij);
|
rsq = delx*delx + dely*dely + delz*delz;
|
||||||
erfc = t * (A1+t*(A2+t*(A3+t*(A4+t*A5)))) * expm2;
|
|
||||||
prefactor = qqrd2e * qtmp*q[j]/r;
|
|
||||||
forcecoul = prefactor * (erfc + EWALD_F*grij*expm2);
|
|
||||||
if (factor_coul < 1.0) {
|
|
||||||
forcecoul -= (1.0-factor_coul)*prefactor;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
union_int_float_t rsq_lookup;
|
|
||||||
rsq_lookup.f = rsq;
|
|
||||||
itable = rsq_lookup.i & ncoulmask;
|
|
||||||
itable >>= ncoulshiftbits;
|
|
||||||
fraction = (rsq_lookup.f - rtable[itable]) * drtable[itable];
|
|
||||||
table = ftable[itable] + fraction*dftable[itable];
|
|
||||||
forcecoul = qtmp*q[j] * table;
|
|
||||||
if (factor_coul < 1.0) {
|
|
||||||
table = ctable[itable] + fraction*dctable[itable];
|
|
||||||
prefactor = qtmp*q[j] * table;
|
|
||||||
forcecoul -= (1.0-factor_coul)*prefactor;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
cforce = forcecoul * r2inv;
|
|
||||||
|
|
||||||
// if i,j are not O atoms, force is applied directly
|
// Coulombic interaction based on modified rsq
|
||||||
// if i or j are O atoms, force is on fictitious atom & partitioned
|
|
||||||
// force partitioning due to Feenstra, J Comp Chem, 20, 786 (1999)
|
if (rsq < cut_coulsq) {
|
||||||
// f_f = fictitious force, fO = f_f (1 - 2 alpha), fH = alpha f_f
|
r2inv = 1 / rsq;
|
||||||
// preserves total force and torque on water molecule
|
if (!ncoultablebits || rsq <= tabinnersq) {
|
||||||
// virial = sum(r x F) where each water's atoms are near xi and xj
|
r = sqrt(rsq);
|
||||||
// vlist stores 2,4,6 atoms whose forces contribute to virial
|
grij = g_ewald * r;
|
||||||
|
expm2 = exp(-grij*grij);
|
||||||
n = 0;
|
t = 1.0 / (1.0 + EWALD_P*grij);
|
||||||
|
erfc = t * (A1+t*(A2+t*(A3+t*(A4+t*A5)))) * expm2;
|
||||||
if (itype != typeO) {
|
prefactor = qqrd2e * qtmp*q[j]/r;
|
||||||
f[i][0] += delx * cforce;
|
forcecoul = prefactor * (erfc + EWALD_F*grij*expm2);
|
||||||
f[i][1] += dely * cforce;
|
if (factor_coul < 1.0) {
|
||||||
f[i][2] += delz * cforce;
|
forcecoul -= (1.0-factor_coul)*prefactor;
|
||||||
|
}
|
||||||
if (vflag) {
|
} else {
|
||||||
v[0] = x[i][0] * delx * cforce;
|
union_int_float_t rsq_lookup;
|
||||||
v[1] = x[i][1] * dely * cforce;
|
rsq_lookup.f = rsq;
|
||||||
v[2] = x[i][2] * delz * cforce;
|
itable = rsq_lookup.i & ncoulmask;
|
||||||
v[3] = x[i][0] * dely * cforce;
|
itable >>= ncoulshiftbits;
|
||||||
v[4] = x[i][0] * delz * cforce;
|
fraction = (rsq_lookup.f - rtable[itable]) * drtable[itable];
|
||||||
v[5] = x[i][1] * delz * cforce;
|
table = ftable[itable] + fraction*dftable[itable];
|
||||||
vlist[n++] = i;
|
forcecoul = qtmp*q[j] * table;
|
||||||
|
if (factor_coul < 1.0) {
|
||||||
|
table = ctable[itable] + fraction*dctable[itable];
|
||||||
|
prefactor = qtmp*q[j] * table;
|
||||||
|
forcecoul -= (1.0-factor_coul)*prefactor;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
cforce = forcecoul * r2inv;
|
||||||
|
|
||||||
fd[0] = delx*cforce;
|
// if i,j are not O atoms, force is applied directly
|
||||||
fd[1] = dely*cforce;
|
// if i or j are O atoms, force is on fictitious atom & partitioned
|
||||||
fd[2] = delz*cforce;
|
// force partitioning due to Feenstra, J Comp Chem, 20, 786 (1999)
|
||||||
|
// f_f = fictitious force, fO = f_f (1 - 2 alpha), fH = alpha f_f
|
||||||
|
// preserves total force and torque on water molecule
|
||||||
|
// virial = sum(r x F) where each water's atoms are near xi and xj
|
||||||
|
// vlist stores 2,4,6 atoms whose forces contribute to virial
|
||||||
|
|
||||||
|
n = 0;
|
||||||
|
|
||||||
|
if (itype != typeO) {
|
||||||
|
f[i][0] += delx * cforce;
|
||||||
|
f[i][1] += dely * cforce;
|
||||||
|
f[i][2] += delz * cforce;
|
||||||
|
|
||||||
|
if (vflag) {
|
||||||
|
v[0] = x[i][0] * delx * cforce;
|
||||||
|
v[1] = x[i][1] * dely * cforce;
|
||||||
|
v[2] = x[i][2] * delz * cforce;
|
||||||
|
v[3] = x[i][0] * dely * cforce;
|
||||||
|
v[4] = x[i][0] * delz * cforce;
|
||||||
|
v[5] = x[i][1] * delz * cforce;
|
||||||
|
vlist[n++] = i;
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
delxOM = x[i][0] - x1[0];
|
fd[0] = delx*cforce;
|
||||||
delyOM = x[i][1] - x1[1];
|
fd[1] = dely*cforce;
|
||||||
delzOM = x[i][2] - x1[2];
|
fd[2] = delz*cforce;
|
||||||
|
|
||||||
ddotf = (delxOM * fd[0] + delyOM * fd[1] + delzOM * fd[2]) /
|
delxOM = x[i][0] - x1[0];
|
||||||
(qdist*qdist);
|
delyOM = x[i][1] - x1[1];
|
||||||
|
delzOM = x[i][2] - x1[2];
|
||||||
|
|
||||||
|
ddotf = (delxOM * fd[0] + delyOM * fd[1] + delzOM * fd[2]) /
|
||||||
|
(qdist*qdist);
|
||||||
|
|
||||||
f1[0] = ddotf * delxOM;
|
f1[0] = ddotf * delxOM;
|
||||||
f1[1] = ddotf * delyOM;
|
f1[1] = ddotf * delyOM;
|
||||||
f1[2] = ddotf * delzOM;
|
f1[2] = ddotf * delzOM;
|
||||||
|
|
||||||
fO[0] = fd[0] - alpha * (fd[0] - f1[0]);
|
fO[0] = fd[0] - alpha * (fd[0] - f1[0]);
|
||||||
fO[1] = fd[1] - alpha * (fd[1] - f1[1]);
|
fO[1] = fd[1] - alpha * (fd[1] - f1[1]);
|
||||||
fO[2] = fd[2] - alpha * (fd[2] - f1[2]);
|
fO[2] = fd[2] - alpha * (fd[2] - f1[2]);
|
||||||
|
|
||||||
fH[0] = 0.5 * alpha * (fd[0] - f1[0]);
|
fH[0] = 0.5 * alpha * (fd[0] - f1[0]);
|
||||||
fH[1] = 0.5 * alpha * (fd[1] - f1[1]);
|
fH[1] = 0.5 * alpha * (fd[1] - f1[1]);
|
||||||
fH[2] = 0.5 * alpha * (fd[2] - f1[2]);
|
fH[2] = 0.5 * alpha * (fd[2] - f1[2]);
|
||||||
|
|
||||||
f[i][0] += fO[0];
|
f[i][0] += fO[0];
|
||||||
f[i][1] += fO[1];
|
f[i][1] += fO[1];
|
||||||
f[i][2] += fO[2];
|
f[i][2] += fO[2];
|
||||||
|
|
||||||
f[iH1][0] += fH[0];
|
f[iH1][0] += fH[0];
|
||||||
f[iH1][1] += fH[1];
|
f[iH1][1] += fH[1];
|
||||||
f[iH1][2] += fH[2];
|
f[iH1][2] += fH[2];
|
||||||
|
|
||||||
f[iH2][0] += fH[0];
|
f[iH2][0] += fH[0];
|
||||||
f[iH2][1] += fH[1];
|
f[iH2][1] += fH[1];
|
||||||
f[iH2][2] += fH[2];
|
f[iH2][2] += fH[2];
|
||||||
|
|
||||||
if (vflag) {
|
if (vflag) {
|
||||||
domain->closest_image(x[i],x[iH1],xH1);
|
domain->closest_image(x[i],x[iH1],xH1);
|
||||||
domain->closest_image(x[i],x[iH2],xH2);
|
domain->closest_image(x[i],x[iH2],xH2);
|
||||||
|
|
||||||
v[0] = x[i][0]*fO[0] + xH1[0]*fH[0] + xH2[0]*fH[0];
|
v[0] = x[i][0]*fO[0] + xH1[0]*fH[0] + xH2[0]*fH[0];
|
||||||
v[1] = x[i][1]*fO[1] + xH1[1]*fH[1] + xH2[1]*fH[1];
|
v[1] = x[i][1]*fO[1] + xH1[1]*fH[1] + xH2[1]*fH[1];
|
||||||
v[2] = x[i][2]*fO[2] + xH1[2]*fH[2] + xH2[2]*fH[2];
|
v[2] = x[i][2]*fO[2] + xH1[2]*fH[2] + xH2[2]*fH[2];
|
||||||
v[3] = x[i][0]*fO[1] + xH1[0]*fH[1] + xH2[0]*fH[1];
|
v[3] = x[i][0]*fO[1] + xH1[0]*fH[1] + xH2[0]*fH[1];
|
||||||
v[4] = x[i][0]*fO[2] + xH1[0]*fH[2] + xH2[0]*fH[2];
|
v[4] = x[i][0]*fO[2] + xH1[0]*fH[2] + xH2[0]*fH[2];
|
||||||
v[5] = x[i][1]*fO[2] + xH1[1]*fH[2] + xH2[1]*fH[2];
|
v[5] = x[i][1]*fO[2] + xH1[1]*fH[2] + xH2[1]*fH[2];
|
||||||
|
|
||||||
vlist[n++] = i;
|
vlist[n++] = i;
|
||||||
vlist[n++] = iH1;
|
vlist[n++] = iH1;
|
||||||
vlist[n++] = iH2;
|
vlist[n++] = iH2;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (jtype != typeO) {
|
||||||
|
f[j][0] -= delx * cforce;
|
||||||
|
f[j][1] -= dely * cforce;
|
||||||
|
f[j][2] -= delz * cforce;
|
||||||
|
|
||||||
|
if (vflag) {
|
||||||
|
v[0] -= x[j][0] * delx * cforce;
|
||||||
|
v[1] -= x[j][1] * dely * cforce;
|
||||||
|
v[2] -= x[j][2] * delz * cforce;
|
||||||
|
v[3] -= x[j][0] * dely * cforce;
|
||||||
|
v[4] -= x[j][0] * delz * cforce;
|
||||||
|
v[5] -= x[j][1] * delz * cforce;
|
||||||
|
vlist[n++] = j;
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
fd[0] = -delx*cforce;
|
||||||
|
fd[1] = -dely*cforce;
|
||||||
|
fd[2] = -delz*cforce;
|
||||||
|
|
||||||
|
delxOM = x[j][0] - x2[0];
|
||||||
|
delyOM = x[j][1] - x2[1];
|
||||||
|
delzOM = x[j][2] - x2[2];
|
||||||
|
|
||||||
|
ddotf = (delxOM * fd[0] + delyOM * fd[1] + delzOM * fd[2]) /
|
||||||
|
(qdist*qdist);
|
||||||
|
|
||||||
|
f1[0] = ddotf * delxOM;
|
||||||
|
f1[1] = ddotf * delyOM;
|
||||||
|
f1[2] = ddotf * delzOM;
|
||||||
|
|
||||||
|
fO[0] = fd[0] - alpha * (fd[0] - f1[0]);
|
||||||
|
fO[1] = fd[1] - alpha * (fd[1] - f1[1]);
|
||||||
|
fO[2] = fd[2] - alpha * (fd[2] - f1[2]);
|
||||||
|
|
||||||
|
fH[0] = 0.5 * alpha * (fd[0] - f1[0]);
|
||||||
|
fH[1] = 0.5 * alpha * (fd[1] - f1[1]);
|
||||||
|
fH[2] = 0.5 * alpha * (fd[2] - f1[2]);
|
||||||
|
|
||||||
|
f[j][0] += fO[0];
|
||||||
|
f[j][1] += fO[1];
|
||||||
|
f[j][2] += fO[2];
|
||||||
|
|
||||||
|
f[jH1][0] += fH[0];
|
||||||
|
f[jH1][1] += fH[1];
|
||||||
|
f[jH1][2] += fH[2];
|
||||||
|
|
||||||
|
f[jH2][0] += fH[0];
|
||||||
|
f[jH2][1] += fH[1];
|
||||||
|
f[jH2][2] += fH[2];
|
||||||
|
|
||||||
|
if (vflag) {
|
||||||
|
domain->closest_image(x[j],x[jH1],xH1);
|
||||||
|
domain->closest_image(x[j],x[jH2],xH2);
|
||||||
|
|
||||||
|
v[0] += x[j][0]*fO[0] + xH1[0]*fH[0] + xH2[0]*fH[0];
|
||||||
|
v[1] += x[j][1]*fO[1] + xH1[1]*fH[1] + xH2[1]*fH[1];
|
||||||
|
v[2] += x[j][2]*fO[2] + xH1[2]*fH[2] + xH2[2]*fH[2];
|
||||||
|
v[3] += x[j][0]*fO[1] + xH1[0]*fH[1] + xH2[0]*fH[1];
|
||||||
|
v[4] += x[j][0]*fO[2] + xH1[0]*fH[2] + xH2[0]*fH[2];
|
||||||
|
v[5] += x[j][1]*fO[2] + xH1[1]*fH[2] + xH2[1]*fH[2];
|
||||||
|
|
||||||
|
vlist[n++] = j;
|
||||||
|
vlist[n++] = jH1;
|
||||||
|
vlist[n++] = jH2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (eflag) {
|
||||||
|
if (!ncoultablebits || rsq <= tabinnersq)
|
||||||
|
ecoul = prefactor*erfc;
|
||||||
|
else {
|
||||||
|
table = etable[itable] + fraction*detable[itable];
|
||||||
|
ecoul = qtmp*q[j] * table;
|
||||||
|
}
|
||||||
|
if (factor_coul < 1.0) ecoul -= (1.0-factor_coul)*prefactor;
|
||||||
|
} else ecoul = 0.0;
|
||||||
|
|
||||||
|
if (evflag) ev_tally_list(n,vlist,ecoul,v);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (jtype != typeO) {
|
|
||||||
f[j][0] -= delx * cforce;
|
|
||||||
f[j][1] -= dely * cforce;
|
|
||||||
f[j][2] -= delz * cforce;
|
|
||||||
|
|
||||||
if (vflag) {
|
|
||||||
v[0] -= x[j][0] * delx * cforce;
|
|
||||||
v[1] -= x[j][1] * dely * cforce;
|
|
||||||
v[2] -= x[j][2] * delz * cforce;
|
|
||||||
v[3] -= x[j][0] * dely * cforce;
|
|
||||||
v[4] -= x[j][0] * delz * cforce;
|
|
||||||
v[5] -= x[j][1] * delz * cforce;
|
|
||||||
vlist[n++] = j;
|
|
||||||
}
|
|
||||||
|
|
||||||
} else {
|
|
||||||
|
|
||||||
fd[0] = -delx*cforce;
|
|
||||||
fd[1] = -dely*cforce;
|
|
||||||
fd[2] = -delz*cforce;
|
|
||||||
|
|
||||||
delxOM = x[j][0] - x2[0];
|
|
||||||
delyOM = x[j][1] - x2[1];
|
|
||||||
delzOM = x[j][2] - x2[2];
|
|
||||||
|
|
||||||
ddotf = (delxOM * fd[0] + delyOM * fd[1] + delzOM * fd[2]) /
|
|
||||||
(qdist*qdist);
|
|
||||||
|
|
||||||
f1[0] = ddotf * delxOM;
|
|
||||||
f1[1] = ddotf * delyOM;
|
|
||||||
f1[2] = ddotf * delzOM;
|
|
||||||
|
|
||||||
fO[0] = fd[0] - alpha * (fd[0] - f1[0]);
|
|
||||||
fO[1] = fd[1] - alpha * (fd[1] - f1[1]);
|
|
||||||
fO[2] = fd[2] - alpha * (fd[2] - f1[2]);
|
|
||||||
|
|
||||||
fH[0] = 0.5 * alpha * (fd[0] - f1[0]);
|
|
||||||
fH[1] = 0.5 * alpha * (fd[1] - f1[1]);
|
|
||||||
fH[2] = 0.5 * alpha * (fd[2] - f1[2]);
|
|
||||||
|
|
||||||
f[j][0] += fO[0];
|
|
||||||
f[j][1] += fO[1];
|
|
||||||
f[j][2] += fO[2];
|
|
||||||
|
|
||||||
f[jH1][0] += fH[0];
|
|
||||||
f[jH1][1] += fH[1];
|
|
||||||
f[jH1][2] += fH[2];
|
|
||||||
|
|
||||||
f[jH2][0] += fH[0];
|
|
||||||
f[jH2][1] += fH[1];
|
|
||||||
f[jH2][2] += fH[2];
|
|
||||||
|
|
||||||
if (vflag) {
|
|
||||||
domain->closest_image(x[j],x[jH1],xH1);
|
|
||||||
domain->closest_image(x[j],x[jH2],xH2);
|
|
||||||
|
|
||||||
v[0] += x[j][0]*fO[0] + xH1[0]*fH[0] + xH2[0]*fH[0];
|
|
||||||
v[1] += x[j][1]*fO[1] + xH1[1]*fH[1] + xH2[1]*fH[1];
|
|
||||||
v[2] += x[j][2]*fO[2] + xH1[2]*fH[2] + xH2[2]*fH[2];
|
|
||||||
v[3] += x[j][0]*fO[1] + xH1[0]*fH[1] + xH2[0]*fH[1];
|
|
||||||
v[4] += x[j][0]*fO[2] + xH1[0]*fH[2] + xH2[0]*fH[2];
|
|
||||||
v[5] += x[j][1]*fO[2] + xH1[1]*fH[2] + xH2[1]*fH[2];
|
|
||||||
|
|
||||||
vlist[n++] = j;
|
|
||||||
vlist[n++] = jH1;
|
|
||||||
vlist[n++] = jH2;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (eflag) {
|
|
||||||
if (!ncoultablebits || rsq <= tabinnersq)
|
|
||||||
ecoul = prefactor*erfc;
|
|
||||||
else {
|
|
||||||
table = etable[itable] + fraction*detable[itable];
|
|
||||||
ecoul = qtmp*q[j] * table;
|
|
||||||
}
|
|
||||||
if (factor_coul < 1.0) ecoul -= (1.0-factor_coul)*prefactor;
|
|
||||||
} else ecoul = 0.0;
|
|
||||||
|
|
||||||
if (evflag) ev_tally_list(n,vlist,ecoul,v);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -401,6 +406,7 @@ void PairLJCutCoulLongTIP4P::init_style()
|
||||||
error->all(FLERR,
|
error->all(FLERR,
|
||||||
"Pair style lj/cut/coul/long/tip4p requires atom attribute q");
|
"Pair style lj/cut/coul/long/tip4p requires atom attribute q");
|
||||||
if ( (strcmp(force->kspace_style,"pppm/tip4p") != 0) &&
|
if ( (strcmp(force->kspace_style,"pppm/tip4p") != 0) &&
|
||||||
|
(strcmp(force->kspace_style,"pppm/tip4p/omp") != 0) &&
|
||||||
(strcmp(force->kspace_style,"pppm/tip4p/proxy") != 0) )
|
(strcmp(force->kspace_style,"pppm/tip4p/proxy") != 0) )
|
||||||
error->all(FLERR,"Pair style is incompatible with KSpace style");
|
error->all(FLERR,"Pair style is incompatible with KSpace style");
|
||||||
if (force->bond == NULL)
|
if (force->bond == NULL)
|
||||||
|
|
|
@ -20,6 +20,8 @@ PACKAGE = asphere class2 colloid dipole fld gpu granular kim \
|
||||||
PACKUSER = user-misc user-atc user-awpmd user-cg-cmm \
|
PACKUSER = user-misc user-atc user-awpmd user-cg-cmm \
|
||||||
user-cuda user-eff user-ewaldn user-omp user-reaxc user-sph
|
user-cuda user-eff user-ewaldn user-omp user-reaxc user-sph
|
||||||
|
|
||||||
|
PACKLIB = gpu kim meam poems reax user-atc user-awpmd user-cuda
|
||||||
|
|
||||||
PACKALL = $(PACKAGE) $(PACKUSER)
|
PACKALL = $(PACKAGE) $(PACKUSER)
|
||||||
|
|
||||||
PACKAGEUC = $(shell echo $(PACKAGE) | tr a-z A-Z)
|
PACKAGEUC = $(shell echo $(PACKAGE) | tr a-z A-Z)
|
||||||
|
@ -48,6 +50,7 @@ help:
|
||||||
@echo 'make no-standard remove all standard packages'
|
@echo 'make no-standard remove all standard packages'
|
||||||
@echo 'make yes-user install all user packages'
|
@echo 'make yes-user install all user packages'
|
||||||
@echo 'make no-user remove all user packages'
|
@echo 'make no-user remove all user packages'
|
||||||
|
@echo 'make no-lib remove all packages with external libs'
|
||||||
@echo ''
|
@echo ''
|
||||||
@echo 'make package-update replace src files with package files'
|
@echo 'make package-update replace src files with package files'
|
||||||
@echo 'make package-overwrite replace package files with src files'
|
@echo 'make package-overwrite replace package files with src files'
|
||||||
|
@ -132,6 +135,7 @@ package:
|
||||||
@echo 'make no-standard remove all standard packages'
|
@echo 'make no-standard remove all standard packages'
|
||||||
@echo 'make yes-user install all user packages'
|
@echo 'make yes-user install all user packages'
|
||||||
@echo 'make no-user remove all user packages'
|
@echo 'make no-user remove all user packages'
|
||||||
|
@echo 'make no-lib remove all packages with external libs'
|
||||||
@echo ''
|
@echo ''
|
||||||
@echo 'make package-update replace src files with package files'
|
@echo 'make package-update replace src files with package files'
|
||||||
@echo 'make package-overwrite replace package files with src files'
|
@echo 'make package-overwrite replace package files with src files'
|
||||||
|
@ -155,6 +159,9 @@ yes-user:
|
||||||
no-user:
|
no-user:
|
||||||
@for p in $(PACKUSER); do $(MAKE) no-$$p; done
|
@for p in $(PACKUSER); do $(MAKE) no-$$p; done
|
||||||
|
|
||||||
|
no-lib:
|
||||||
|
@for p in $(PACKLIB); do $(MAKE) no-$$p; done
|
||||||
|
|
||||||
yes-%:
|
yes-%:
|
||||||
@if [ ! -e Makefile.package ]; \
|
@if [ ! -e Makefile.package ]; \
|
||||||
then cp Makefile.package.empty Makefile.package; fi
|
then cp Makefile.package.empty Makefile.package; fi
|
||||||
|
|
|
@ -77,8 +77,8 @@ void PairLJCutCoulLongTIP4POpt::compute(int eflag, int vflag)
|
||||||
}
|
}
|
||||||
|
|
||||||
// cache corrected M positions in mpos[]
|
// cache corrected M positions in mpos[]
|
||||||
double **x = atom->x;
|
const double * const * const x = atom->x;
|
||||||
int *type = atom->type;
|
const int * const type = atom->type;
|
||||||
for (int i = 0; i < nlocal; i++) {
|
for (int i = 0; i < nlocal; i++) {
|
||||||
if (type[i] == typeO) {
|
if (type[i] == typeO) {
|
||||||
find_M(i,h1idx[i],h2idx[i],mpos[i]);
|
find_M(i,h1idx[i],h2idx[i],mpos[i]);
|
||||||
|
@ -101,56 +101,30 @@ void PairLJCutCoulLongTIP4POpt::compute(int eflag, int vflag)
|
||||||
if (!ncoultablebits) {
|
if (!ncoultablebits) {
|
||||||
if (evflag) {
|
if (evflag) {
|
||||||
if (eflag) {
|
if (eflag) {
|
||||||
if (vflag) {
|
if (vflag) return eval<1,1,1,1>();
|
||||||
if (force->newton_pair) return eval<1,1,1,1,0>();
|
else return eval<1,1,1,0>();
|
||||||
else return eval<1,1,1,0,0>();
|
|
||||||
} else {
|
|
||||||
if (force->newton_pair) return eval<1,1,0,1,0>();
|
|
||||||
else return eval<1,1,0,0,0>();
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
if (vflag) {
|
if (vflag) return eval<1,1,0,1>();
|
||||||
if (force->newton_pair) return eval<1,0,1,1,0>();
|
else return eval<1,1,0,0>();
|
||||||
else return eval<1,0,1,0,0>();
|
|
||||||
} else {
|
|
||||||
if (force->newton_pair) return eval<1,0,0,1,0>();
|
|
||||||
else return eval<1,0,0,0,0>();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else {
|
} else return eval<1,0,0,0>();
|
||||||
if (force->newton_pair) return eval<0,0,0,1,0>();
|
|
||||||
else return eval<0,0,0,0,0>();
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
if (evflag) {
|
if (evflag) {
|
||||||
if (eflag) {
|
if (eflag) {
|
||||||
if (vflag) {
|
if (vflag) return eval<0,1,1,1>();
|
||||||
if (force->newton_pair) return eval<1,1,1,1,1>();
|
else return eval<0,1,1,0>();
|
||||||
else return eval<1,1,1,0,1>();
|
|
||||||
} else {
|
|
||||||
if (force->newton_pair) return eval<1,1,0,1,1>();
|
|
||||||
else return eval<1,1,0,0,1>();
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
if (vflag) {
|
if (vflag) return eval<0,1,0,1>();
|
||||||
if (force->newton_pair) return eval<1,0,1,1,1>();
|
else return eval<0,1,0,0>();
|
||||||
else return eval<1,0,1,0,1>();
|
|
||||||
} else {
|
|
||||||
if (force->newton_pair) return eval<1,0,0,1,1>();
|
|
||||||
else return eval<1,0,0,0,1>();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else {
|
} else return eval<0,0,0,0>();
|
||||||
if (force->newton_pair) return eval<0,0,0,1,1>();
|
|
||||||
else return eval<0,0,0,0,1>();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
template < const int EVFLAG, const int EFLAG, const int VFLAG,
|
template < const int CTABLE, const int EVFLAG,
|
||||||
const int NEWTON_PAIR, const int CTABLE >
|
const int EFLAG, const int VFLAG>
|
||||||
void PairLJCutCoulLongTIP4POpt::eval()
|
void PairLJCutCoulLongTIP4POpt::eval()
|
||||||
{
|
{
|
||||||
int i,j,ii,jj,inum,jnum,itype,jtype,itable;
|
int i,j,ii,jj,inum,jnum,itype,jtype,itable;
|
||||||
|
@ -158,27 +132,27 @@ void PairLJCutCoulLongTIP4POpt::eval()
|
||||||
int iH1,iH2,jH1,jH2;
|
int iH1,iH2,jH1,jH2;
|
||||||
double qtmp,xtmp,ytmp,ztmp,delx,dely,delz,evdwl,ecoul;
|
double qtmp,xtmp,ytmp,ztmp,delx,dely,delz,evdwl,ecoul;
|
||||||
double fraction,table;
|
double fraction,table;
|
||||||
double delxOM, delyOM, delzOM;
|
double delxOM,delyOM,delzOM;
|
||||||
double r,r2inv,r6inv,forcecoul,forcelj,cforce;
|
double r,rsq,r2inv,r6inv,forcecoul,forcelj,cforce;
|
||||||
double factor_coul,factor_lj;
|
double factor_coul,factor_lj;
|
||||||
double grij,expm2,prefactor,t,erfc,ddotf;
|
double grij,expm2,prefactor,t,erfc,ddotf;
|
||||||
double v[6],xH1[3],xH2[3];
|
double v[6],xH1[3],xH2[3];
|
||||||
double fdx,fdy,fdz,f1x,f1y,f1z,fOx,fOy,fOz,fHx,fHy,fHz;
|
double fdx,fdy,fdz,f1x,f1y,f1z,fOx,fOy,fOz,fHx,fHy,fHz;
|
||||||
double *x1,*x2;
|
double *x1,*x2;
|
||||||
int *ilist,*jlist,*numneigh,**firstneigh;
|
int *ilist,*jlist,*numneigh,**firstneigh;
|
||||||
double rsq;
|
|
||||||
|
|
||||||
evdwl = ecoul = 0.0;
|
evdwl = ecoul = 0.0;
|
||||||
|
|
||||||
double **f = atom->f;
|
const double * const * const x = atom->x;
|
||||||
double **x = atom->x;
|
double * const * const f = atom->f;
|
||||||
double *q = atom->q;
|
const double * const q = atom->q;
|
||||||
int *type = atom->type;
|
const int * const type = atom->type;
|
||||||
int nlocal = atom->nlocal;
|
const int nlocal = atom->nlocal;
|
||||||
double *special_coul = force->special_coul;
|
const double * const special_coul = force->special_coul;
|
||||||
double *special_lj = force->special_lj;
|
const double * const special_lj = force->special_lj;
|
||||||
int newton_pair = force->newton_pair;
|
const double qqrd2e = force->qqrd2e;
|
||||||
double qqrd2e = force->qqrd2e;
|
const double cut_coulsqplus = (cut_coul+2.0*qdist) * (cut_coul+2.0*qdist);
|
||||||
|
|
||||||
double fxtmp,fytmp,fztmp;
|
double fxtmp,fytmp,fztmp;
|
||||||
|
|
||||||
inum = list->inum;
|
inum = list->inum;
|
||||||
|
@ -214,34 +188,36 @@ void PairLJCutCoulLongTIP4POpt::eval()
|
||||||
delz = ztmp - x[j][2];
|
delz = ztmp - x[j][2];
|
||||||
rsq = delx*delx + dely*dely + delz*delz;
|
rsq = delx*delx + dely*dely + delz*delz;
|
||||||
jtype = type[j];
|
jtype = type[j];
|
||||||
|
|
||||||
if (rsq < cutsq[itype][jtype]) {
|
|
||||||
|
|
||||||
|
// LJ interaction based on true rsq
|
||||||
|
|
||||||
|
if (rsq < cut_ljsq[itype][jtype]) {
|
||||||
r2inv = 1.0/rsq;
|
r2inv = 1.0/rsq;
|
||||||
|
r6inv = r2inv*r2inv*r2inv;
|
||||||
|
forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
|
||||||
|
forcelj *= factor_lj * r2inv;
|
||||||
|
|
||||||
if (rsq < cut_ljsq[itype][jtype]) {
|
fxtmp += delx*forcelj;
|
||||||
r6inv = r2inv*r2inv*r2inv;
|
fytmp += dely*forcelj;
|
||||||
forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
|
fztmp += delz*forcelj;
|
||||||
forcelj *= factor_lj * r2inv;
|
f[j][0] -= delx*forcelj;
|
||||||
|
f[j][1] -= dely*forcelj;
|
||||||
|
f[j][2] -= delz*forcelj;
|
||||||
|
|
||||||
fxtmp += delx*forcelj;
|
if (EFLAG) {
|
||||||
fytmp += dely*forcelj;
|
evdwl = r6inv*(lj3[itype][jtype]*r6inv-lj4[itype][jtype]) -
|
||||||
fztmp += delz*forcelj;
|
offset[itype][jtype];
|
||||||
f[j][0] -= delx*forcelj;
|
evdwl *= factor_lj;
|
||||||
f[j][1] -= dely*forcelj;
|
} else evdwl = 0.0;
|
||||||
f[j][2] -= delz*forcelj;
|
|
||||||
|
|
||||||
if (EFLAG) {
|
if (EVFLAG) ev_tally(i,j,nlocal,/* newton_pair = */ 1,
|
||||||
evdwl = r6inv*(lj3[itype][jtype]*r6inv-lj4[itype][jtype]) -
|
evdwl,0.0,forcelj,delx,dely,delz);
|
||||||
offset[itype][jtype];
|
}
|
||||||
evdwl *= factor_lj;
|
|
||||||
} else evdwl = 0.0;
|
|
||||||
|
|
||||||
if (EVFLAG) ev_tally(i,j,nlocal,newton_pair,
|
// adjust rsq and delxyz for off-site O charge(s),
|
||||||
evdwl,0.0,forcelj,delx,dely,delz);
|
// but only if they are within reach
|
||||||
}
|
|
||||||
|
|
||||||
// adjust rsq and delxyz for off-site O charge(s)
|
if (rsq < cut_coulsqplus) {
|
||||||
|
|
||||||
if (itype == typeO || jtype == typeO) {
|
if (itype == typeO || jtype == typeO) {
|
||||||
x2 = mpos[j];
|
x2 = mpos[j];
|
||||||
|
@ -254,12 +230,12 @@ void PairLJCutCoulLongTIP4POpt::eval()
|
||||||
delz = x1[2] - x2[2];
|
delz = x1[2] - x2[2];
|
||||||
rsq = delx*delx + dely*dely + delz*delz;
|
rsq = delx*delx + dely*dely + delz*delz;
|
||||||
}
|
}
|
||||||
|
|
||||||
// test current rsq against cutoff and compute Coulombic force
|
// Coulombic interaction based on modified rsq
|
||||||
|
|
||||||
if (rsq < cut_coulsq) {
|
if (rsq < cut_coulsq) {
|
||||||
r2inv = 1 / rsq;
|
r2inv = 1 / rsq;
|
||||||
if (!CTABLE || rsq <= tabinnersq) {
|
if (CTABLE || rsq <= tabinnersq) {
|
||||||
r = sqrt(rsq);
|
r = sqrt(rsq);
|
||||||
grij = g_ewald * r;
|
grij = g_ewald * r;
|
||||||
expm2 = exp(-grij*grij);
|
expm2 = exp(-grij*grij);
|
||||||
|
@ -314,40 +290,40 @@ void PairLJCutCoulLongTIP4POpt::eval()
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
fdx = delx*cforce;
|
fdx = delx*cforce;
|
||||||
fdy = dely*cforce;
|
fdy = dely*cforce;
|
||||||
fdz = delz*cforce;
|
fdz = delz*cforce;
|
||||||
|
|
||||||
delxOM = x[i][0] - x1[0];
|
delxOM = x[i][0] - x1[0];
|
||||||
delyOM = x[i][1] - x1[1];
|
delyOM = x[i][1] - x1[1];
|
||||||
delzOM = x[i][2] - x1[2];
|
delzOM = x[i][2] - x1[2];
|
||||||
|
|
||||||
ddotf = (delxOM * fdx + delyOM * fdy + delzOM * fdz) /
|
ddotf = (delxOM * fdx + delyOM * fdy + delzOM * fdz) /
|
||||||
(qdist*qdist);
|
(qdist*qdist);
|
||||||
|
|
||||||
f1x = alpha * (fdx - ddotf * delxOM);
|
f1x = alpha * (fdx - ddotf * delxOM);
|
||||||
f1y = alpha * (fdy - ddotf * delyOM);
|
f1y = alpha * (fdy - ddotf * delyOM);
|
||||||
f1z = alpha * (fdz - ddotf * delzOM);
|
f1z = alpha * (fdz - ddotf * delzOM);
|
||||||
|
|
||||||
fOx = fdx - f1x;
|
fOx = fdx - f1x;
|
||||||
fOy = fdy - f1y;
|
fOy = fdy - f1y;
|
||||||
fOz = fdz - f1z;
|
fOz = fdz - f1z;
|
||||||
|
|
||||||
fHx = 0.5 * f1x;
|
fHx = 0.5 * f1x;
|
||||||
fHy = 0.5 * f1y;
|
fHy = 0.5 * f1y;
|
||||||
fHz = 0.5 * f1z;
|
fHz = 0.5 * f1z;
|
||||||
|
|
||||||
fxtmp += fOx;
|
fxtmp += fOx;
|
||||||
fytmp += fOy;
|
fytmp += fOy;
|
||||||
fztmp += fOz;
|
fztmp += fOz;
|
||||||
|
|
||||||
f[iH1][0] += fHx;
|
f[iH1][0] += fHx;
|
||||||
f[iH1][1] += fHy;
|
f[iH1][1] += fHy;
|
||||||
f[iH1][2] += fHz;
|
f[iH1][2] += fHz;
|
||||||
|
|
||||||
f[iH2][0] += fHx;
|
f[iH2][0] += fHx;
|
||||||
f[iH2][1] += fHy;
|
f[iH2][1] += fHy;
|
||||||
f[iH2][2] += fHz;
|
f[iH2][2] += fHz;
|
||||||
|
|
||||||
if (VFLAG) {
|
if (VFLAG) {
|
||||||
domain->closest_image(x[i],x[iH1],xH1);
|
domain->closest_image(x[i],x[iH1],xH1);
|
||||||
|
@ -391,32 +367,32 @@ void PairLJCutCoulLongTIP4POpt::eval()
|
||||||
delyOM = x[j][1] - x2[1];
|
delyOM = x[j][1] - x2[1];
|
||||||
delzOM = x[j][2] - x2[2];
|
delzOM = x[j][2] - x2[2];
|
||||||
|
|
||||||
ddotf = (delxOM * fdx + delyOM * fdy + delzOM * fdz) /
|
ddotf = (delxOM * fdx + delyOM * fdy + delzOM * fdz) /
|
||||||
(qdist*qdist);
|
(qdist*qdist);
|
||||||
|
|
||||||
f1x = alpha * (fdx - ddotf * delxOM);
|
f1x = alpha * (fdx - ddotf * delxOM);
|
||||||
f1y = alpha * (fdy - ddotf * delyOM);
|
f1y = alpha * (fdy - ddotf * delyOM);
|
||||||
f1z = alpha * (fdz - ddotf * delzOM);
|
f1z = alpha * (fdz - ddotf * delzOM);
|
||||||
|
|
||||||
fOx = fdx - f1x;
|
fOx = fdx - f1x;
|
||||||
fOy = fdy - f1y;
|
fOy = fdy - f1y;
|
||||||
fOz = fdz - f1z;
|
fOz = fdz - f1z;
|
||||||
|
|
||||||
fHx = 0.5 * f1x;
|
fHx = 0.5 * f1x;
|
||||||
fHy = 0.5 * f1y;
|
fHy = 0.5 * f1y;
|
||||||
fHz = 0.5 * f1z;
|
fHz = 0.5 * f1z;
|
||||||
|
|
||||||
f[j][0] += fOx;
|
f[j][0] += fOx;
|
||||||
f[j][1] += fOy;
|
f[j][1] += fOy;
|
||||||
f[j][2] += fOz;
|
f[j][2] += fOz;
|
||||||
|
|
||||||
f[jH1][0] += fHx;
|
f[jH1][0] += fHx;
|
||||||
f[jH1][1] += fHy;
|
f[jH1][1] += fHy;
|
||||||
f[jH1][2] += fHz;
|
f[jH1][2] += fHz;
|
||||||
|
|
||||||
f[jH2][0] += fHx;
|
f[jH2][0] += fHx;
|
||||||
f[jH2][1] += fHy;
|
f[jH2][1] += fHy;
|
||||||
f[jH2][2] += fHz;
|
f[jH2][2] += fHz;
|
||||||
|
|
||||||
if (VFLAG) {
|
if (VFLAG) {
|
||||||
domain->closest_image(x[j],x[jH1],xH1);
|
domain->closest_image(x[j],x[jH1],xH1);
|
||||||
|
@ -436,7 +412,7 @@ void PairLJCutCoulLongTIP4POpt::eval()
|
||||||
}
|
}
|
||||||
|
|
||||||
if (EFLAG) {
|
if (EFLAG) {
|
||||||
if (!CTABLE || rsq <= tabinnersq)
|
if (CTABLE || rsq <= tabinnersq)
|
||||||
ecoul = prefactor*erfc;
|
ecoul = prefactor*erfc;
|
||||||
else {
|
else {
|
||||||
table = etable[itable] + fraction*detable[itable];
|
table = etable[itable] + fraction*detable[itable];
|
||||||
|
|
|
@ -39,7 +39,7 @@ class PairLJCutCoulLongTIP4POpt : public PairLJCutCoulLongTIP4P {
|
||||||
double **mpos; // coordinates corrected for m-shift.
|
double **mpos; // coordinates corrected for m-shift.
|
||||||
void find_M_permissive(int, int &, int &, double *);
|
void find_M_permissive(int, int &, int &, double *);
|
||||||
|
|
||||||
template < const int, const int, const int, const int, const int >
|
template < const int, const int, const int, const int >
|
||||||
void eval();
|
void eval();
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -42,6 +42,11 @@ PairLJCutCoulLongTIP4POMP::PairLJCutCoulLongTIP4POMP(LAMMPS *lmp) :
|
||||||
suffix_flag |= Suffix::OMP;
|
suffix_flag |= Suffix::OMP;
|
||||||
respa_enable = 0;
|
respa_enable = 0;
|
||||||
|
|
||||||
|
// TIP4P cannot compute virial as F dot r
|
||||||
|
// due to find_M() finding bonded H atoms which are not near O atom
|
||||||
|
|
||||||
|
no_virial_fdotr_compute = 1;
|
||||||
|
|
||||||
// for caching m-shift corrected positions
|
// for caching m-shift corrected positions
|
||||||
maxmpos = 0;
|
maxmpos = 0;
|
||||||
h1idx = h2idx = NULL;
|
h1idx = h2idx = NULL;
|
||||||
|
@ -111,17 +116,28 @@ void PairLJCutCoulLongTIP4POMP::compute(int eflag, int vflag)
|
||||||
ThrData *thr = fix->get_thr(tid);
|
ThrData *thr = fix->get_thr(tid);
|
||||||
ev_setup_thr(eflag, vflag, nall, eatom, vatom, thr);
|
ev_setup_thr(eflag, vflag, nall, eatom, vatom, thr);
|
||||||
|
|
||||||
|
if (!ncoultablebits) {
|
||||||
if (evflag) {
|
if (evflag) {
|
||||||
if (eflag) {
|
if (eflag) {
|
||||||
if (vflag) eval<1,1,1>(ifrom, ito, thr);
|
if (vflag) eval<1,1,1,1>(ifrom, ito, thr);
|
||||||
else eval<1,1,0>(ifrom, ito, thr);
|
else eval<1,1,1,0>(ifrom, ito, thr);
|
||||||
} else {
|
} else {
|
||||||
if (vflag) eval<1,0,1>(ifrom, ito, thr);
|
if (vflag) eval<1,1,0,1>(ifrom, ito, thr);
|
||||||
else eval<1,0,0>(ifrom, ito, thr);
|
else eval<1,1,0,0>(ifrom, ito, thr);
|
||||||
}
|
}
|
||||||
} else {
|
} else eval<1,0,0,0>(ifrom, ito, thr);
|
||||||
eval<0,0,0>(ifrom, ito, thr);
|
} else {
|
||||||
}
|
if (evflag) {
|
||||||
|
if (eflag) {
|
||||||
|
if (vflag) eval<0,1,1,1>(ifrom, ito, thr);
|
||||||
|
else eval<0,1,1,0>(ifrom, ito, thr);
|
||||||
|
} else {
|
||||||
|
if (vflag) eval<0,1,0,1>(ifrom, ito, thr);
|
||||||
|
else eval<0,1,0,0>(ifrom, ito, thr);
|
||||||
|
}
|
||||||
|
} else eval<0,0,0,0>(ifrom, ito, thr);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
reduce_thr(this, eflag, vflag, thr);
|
reduce_thr(this, eflag, vflag, thr);
|
||||||
} // end of omp parallel region
|
} // end of omp parallel region
|
||||||
|
@ -129,7 +145,7 @@ void PairLJCutCoulLongTIP4POMP::compute(int eflag, int vflag)
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
template <int EVFLAG, int EFLAG, int VFLAG>
|
template <const int CTABLE, const int EVFLAG, const int EFLAG, const int VFLAG>
|
||||||
void PairLJCutCoulLongTIP4POMP::eval(int iifrom, int iito, ThrData * const thr)
|
void PairLJCutCoulLongTIP4POMP::eval(int iifrom, int iito, ThrData * const thr)
|
||||||
{
|
{
|
||||||
int i,j,ii,jj,jnum,itype,jtype,itable;
|
int i,j,ii,jj,jnum,itype,jtype,itable;
|
||||||
|
@ -157,6 +173,8 @@ void PairLJCutCoulLongTIP4POMP::eval(int iifrom, int iito, ThrData * const thr)
|
||||||
const double * const special_coul = force->special_coul;
|
const double * const special_coul = force->special_coul;
|
||||||
const double * const special_lj = force->special_lj;
|
const double * const special_lj = force->special_lj;
|
||||||
const double qqrd2e = force->qqrd2e;
|
const double qqrd2e = force->qqrd2e;
|
||||||
|
const double cut_coulsqplus = (cut_coul+2.0*qdist) * (cut_coul+2.0*qdist);
|
||||||
|
|
||||||
double fxtmp,fytmp,fztmp;
|
double fxtmp,fytmp,fztmp;
|
||||||
|
|
||||||
ilist = list->ilist;
|
ilist = list->ilist;
|
||||||
|
@ -193,34 +211,37 @@ void PairLJCutCoulLongTIP4POMP::eval(int iifrom, int iito, ThrData * const thr)
|
||||||
rsq = delx*delx + dely*dely + delz*delz;
|
rsq = delx*delx + dely*dely + delz*delz;
|
||||||
jtype = type[j];
|
jtype = type[j];
|
||||||
|
|
||||||
if (rsq < cutsq[itype][jtype]) {
|
// LJ interaction based on true rsq
|
||||||
|
|
||||||
|
if (rsq < cut_ljsq[itype][jtype]) {
|
||||||
r2inv = 1.0/rsq;
|
r2inv = 1.0/rsq;
|
||||||
if (rsq < cut_ljsq[itype][jtype]) {
|
r6inv = r2inv*r2inv*r2inv;
|
||||||
r6inv = r2inv*r2inv*r2inv;
|
forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
|
||||||
forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
|
forcelj *= factor_lj * r2inv;
|
||||||
forcelj *= factor_lj * r2inv;
|
|
||||||
|
|
||||||
fxtmp += delx*forcelj;
|
fxtmp += delx*forcelj;
|
||||||
fytmp += dely*forcelj;
|
fytmp += dely*forcelj;
|
||||||
fztmp += delz*forcelj;
|
fztmp += delz*forcelj;
|
||||||
f[j][0] -= delx*forcelj;
|
f[j][0] -= delx*forcelj;
|
||||||
f[j][1] -= dely*forcelj;
|
f[j][1] -= dely*forcelj;
|
||||||
f[j][2] -= delz*forcelj;
|
f[j][2] -= delz*forcelj;
|
||||||
|
|
||||||
if (EFLAG) {
|
if (EFLAG) {
|
||||||
evdwl = r6inv*(lj3[itype][jtype]*r6inv-lj4[itype][jtype]) -
|
evdwl = r6inv*(lj3[itype][jtype]*r6inv-lj4[itype][jtype]) -
|
||||||
offset[itype][jtype];
|
offset[itype][jtype];
|
||||||
evdwl *= factor_lj;
|
evdwl *= factor_lj;
|
||||||
} else evdwl = 0.0;
|
} else evdwl = 0.0;
|
||||||
|
|
||||||
if (EVFLAG) ev_tally_thr(this,i,j,nlocal, /* newton_pair = */ 1,
|
if (EVFLAG) ev_tally_thr(this,i,j,nlocal, /* newton_pair = */ 1,
|
||||||
evdwl,0.0,forcelj,delx,dely,delz,thr);
|
evdwl,0.0,forcelj,delx,dely,delz,thr);
|
||||||
}
|
}
|
||||||
|
|
||||||
// adjust rsq and delxyz for off-site O charge(s)
|
// adjust rsq and delxyz for off-site O charge(s),
|
||||||
|
// but only if they are within reach
|
||||||
|
|
||||||
if (itype == typeO || jtype == typeO) {
|
if (rsq < cut_coulsqplus) {
|
||||||
|
|
||||||
|
if (itype == typeO || jtype == typeO) {
|
||||||
x2 = mpos[j];
|
x2 = mpos[j];
|
||||||
jH1 = h1idx[j];
|
jH1 = h1idx[j];
|
||||||
jH2 = h2idx[j];
|
jH2 = h2idx[j];
|
||||||
|
@ -235,11 +256,11 @@ void PairLJCutCoulLongTIP4POMP::eval(int iifrom, int iito, ThrData * const thr)
|
||||||
rsq = delx*delx + dely*dely + delz*delz;
|
rsq = delx*delx + dely*dely + delz*delz;
|
||||||
}
|
}
|
||||||
|
|
||||||
// test current rsq against cutoff and compute Coulombic force
|
// Coulombic interaction based on modified rsq
|
||||||
|
|
||||||
if (rsq < cut_coulsq) {
|
if (rsq < cut_coulsq) {
|
||||||
r2inv = 1 / rsq;
|
r2inv = 1 / rsq;
|
||||||
if (!ncoultablebits || rsq <= tabinnersq) {
|
if (CTABLE || rsq <= tabinnersq) {
|
||||||
r = sqrt(rsq);
|
r = sqrt(rsq);
|
||||||
grij = g_ewald * r;
|
grij = g_ewald * r;
|
||||||
expm2 = exp(-grij*grij);
|
expm2 = exp(-grij*grij);
|
||||||
|
@ -294,40 +315,40 @@ void PairLJCutCoulLongTIP4POMP::eval(int iifrom, int iito, ThrData * const thr)
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
fdx = delx*cforce;
|
fdx = delx*cforce;
|
||||||
fdy = dely*cforce;
|
fdy = dely*cforce;
|
||||||
fdz = delz*cforce;
|
fdz = delz*cforce;
|
||||||
|
|
||||||
delxOM = x[i][0] - x1[0];
|
delxOM = x[i][0] - x1[0];
|
||||||
delyOM = x[i][1] - x1[1];
|
delyOM = x[i][1] - x1[1];
|
||||||
delzOM = x[i][2] - x1[2];
|
delzOM = x[i][2] - x1[2];
|
||||||
|
|
||||||
ddotf = (delxOM * fdx + delyOM * fdy + delzOM * fdz) /
|
ddotf = (delxOM * fdx + delyOM * fdy + delzOM * fdz) /
|
||||||
(qdist*qdist);
|
(qdist*qdist);
|
||||||
|
|
||||||
f1x = alpha * (fdx - ddotf * delxOM);
|
f1x = alpha * (fdx - ddotf * delxOM);
|
||||||
f1y = alpha * (fdy - ddotf * delyOM);
|
f1y = alpha * (fdy - ddotf * delyOM);
|
||||||
f1z = alpha * (fdz - ddotf * delzOM);
|
f1z = alpha * (fdz - ddotf * delzOM);
|
||||||
|
|
||||||
fOx = fdx - f1x;
|
fOx = fdx - f1x;
|
||||||
fOy = fdy - f1y;
|
fOy = fdy - f1y;
|
||||||
fOz = fdz - f1z;
|
fOz = fdz - f1z;
|
||||||
|
|
||||||
fHx = 0.5 * f1x;
|
fHx = 0.5 * f1x;
|
||||||
fHy = 0.5 * f1y;
|
fHy = 0.5 * f1y;
|
||||||
fHz = 0.5 * f1z;
|
fHz = 0.5 * f1z;
|
||||||
|
|
||||||
fxtmp += fOx;
|
fxtmp += fOx;
|
||||||
fytmp += fOy;
|
fytmp += fOy;
|
||||||
fztmp += fOz;
|
fztmp += fOz;
|
||||||
|
|
||||||
f[iH1][0] += fHx;
|
f[iH1][0] += fHx;
|
||||||
f[iH1][1] += fHy;
|
f[iH1][1] += fHy;
|
||||||
f[iH1][2] += fHz;
|
f[iH1][2] += fHz;
|
||||||
|
|
||||||
f[iH2][0] += fHx;
|
f[iH2][0] += fHx;
|
||||||
f[iH2][1] += fHy;
|
f[iH2][1] += fHy;
|
||||||
f[iH2][2] += fHz;
|
f[iH2][2] += fHz;
|
||||||
|
|
||||||
if (VFLAG) {
|
if (VFLAG) {
|
||||||
domain->closest_image(x[i],x[iH1],xH1);
|
domain->closest_image(x[i],x[iH1],xH1);
|
||||||
|
@ -371,32 +392,32 @@ void PairLJCutCoulLongTIP4POMP::eval(int iifrom, int iito, ThrData * const thr)
|
||||||
delyOM = x[j][1] - x2[1];
|
delyOM = x[j][1] - x2[1];
|
||||||
delzOM = x[j][2] - x2[2];
|
delzOM = x[j][2] - x2[2];
|
||||||
|
|
||||||
ddotf = (delxOM * fdx + delyOM * fdy + delzOM * fdz) /
|
ddotf = (delxOM * fdx + delyOM * fdy + delzOM * fdz) /
|
||||||
(qdist*qdist);
|
(qdist*qdist);
|
||||||
|
|
||||||
f1x = alpha * (fdx - ddotf * delxOM);
|
f1x = alpha * (fdx - ddotf * delxOM);
|
||||||
f1y = alpha * (fdy - ddotf * delyOM);
|
f1y = alpha * (fdy - ddotf * delyOM);
|
||||||
f1z = alpha * (fdz - ddotf * delzOM);
|
f1z = alpha * (fdz - ddotf * delzOM);
|
||||||
|
|
||||||
fOx = fdx - f1x;
|
fOx = fdx - f1x;
|
||||||
fOy = fdy - f1y;
|
fOy = fdy - f1y;
|
||||||
fOz = fdz - f1z;
|
fOz = fdz - f1z;
|
||||||
|
|
||||||
fHx = 0.5 * f1x;
|
fHx = 0.5 * f1x;
|
||||||
fHy = 0.5 * f1y;
|
fHy = 0.5 * f1y;
|
||||||
fHz = 0.5 * f1z;
|
fHz = 0.5 * f1z;
|
||||||
|
|
||||||
f[j][0] += fOx;
|
f[j][0] += fOx;
|
||||||
f[j][1] += fOy;
|
f[j][1] += fOy;
|
||||||
f[j][2] += fOz;
|
f[j][2] += fOz;
|
||||||
|
|
||||||
f[jH1][0] += fHx;
|
f[jH1][0] += fHx;
|
||||||
f[jH1][1] += fHy;
|
f[jH1][1] += fHy;
|
||||||
f[jH1][2] += fHz;
|
f[jH1][2] += fHz;
|
||||||
|
|
||||||
f[jH2][0] += fHx;
|
f[jH2][0] += fHx;
|
||||||
f[jH2][1] += fHy;
|
f[jH2][1] += fHy;
|
||||||
f[jH2][2] += fHz;
|
f[jH2][2] += fHz;
|
||||||
|
|
||||||
if (VFLAG) {
|
if (VFLAG) {
|
||||||
domain->closest_image(x[j],x[jH1],xH1);
|
domain->closest_image(x[j],x[jH1],xH1);
|
||||||
|
@ -416,7 +437,7 @@ void PairLJCutCoulLongTIP4POMP::eval(int iifrom, int iito, ThrData * const thr)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (EFLAG) {
|
if (EFLAG) {
|
||||||
if (!ncoultablebits || rsq <= tabinnersq)
|
if (CTABLE || rsq <= tabinnersq)
|
||||||
ecoul = prefactor*erfc;
|
ecoul = prefactor*erfc;
|
||||||
else {
|
else {
|
||||||
table = etable[itable] + fraction*detable[itable];
|
table = etable[itable] + fraction*detable[itable];
|
||||||
|
|
|
@ -46,7 +46,7 @@ class PairLJCutCoulLongTIP4POMP : public PairLJCutCoulLongTIP4P, public ThrOMP {
|
||||||
void find_M_permissive(int, int &, int &, double *);
|
void find_M_permissive(int, int &, int &, double *);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
template <int EVFLAG, int EFLAG, int VFLAG>
|
template <int CFLAG, int EVFLAG, int EFLAG, int VFLAG>
|
||||||
void eval(int ifrom, int ito, ThrData * const thr);
|
void eval(int ifrom, int ito, ThrData * const thr);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
|
|
||||||
#include "math.h"
|
#include "math.h"
|
||||||
#include "pair_lj_cut_coul_pppm_tip4p_omp.h"
|
#include "pair_lj_cut_coul_pppm_tip4p_omp.h"
|
||||||
#include "pppm_proxy.h"
|
#include "pppm_tip4p_proxy.h"
|
||||||
#include "atom.h"
|
#include "atom.h"
|
||||||
#include "comm.h"
|
#include "comm.h"
|
||||||
#include "domain.h"
|
#include "domain.h"
|
||||||
|
@ -74,7 +74,7 @@ void PairLJCutCoulPPPMTIP4POMP::init_style()
|
||||||
if (strcmp(force->kspace_style,"pppm/tip4p/proxy") != 0)
|
if (strcmp(force->kspace_style,"pppm/tip4p/proxy") != 0)
|
||||||
error->all(FLERR,"kspace style pppm/tip4p/proxy is required with this pair style");
|
error->all(FLERR,"kspace style pppm/tip4p/proxy is required with this pair style");
|
||||||
|
|
||||||
kspace = static_cast<PPPMProxy *>(force->kspace);
|
kspace = static_cast<PPPMTIP4PProxy *>(force->kspace);
|
||||||
|
|
||||||
PairLJCutCoulLongTIP4P::init_style();
|
PairLJCutCoulLongTIP4P::init_style();
|
||||||
}
|
}
|
||||||
|
@ -137,19 +137,29 @@ void PairLJCutCoulPPPMTIP4POMP::compute(int eflag, int vflag)
|
||||||
if (tid < nproxy) {
|
if (tid < nproxy) {
|
||||||
kspace->compute_proxy(eflag,vflag);
|
kspace->compute_proxy(eflag,vflag);
|
||||||
} else {
|
} else {
|
||||||
if (evflag) {
|
if (!ncoultablebits) {
|
||||||
if (eflag) {
|
if (evflag) {
|
||||||
if (vflag) eval<1,1,1>(ifrom, ito, thr);
|
if (eflag) {
|
||||||
else eval<1,1,0>(ifrom, ito, thr);
|
if (vflag) eval<1,1,1,1>(ifrom, ito, thr);
|
||||||
} else {
|
else eval<1,1,1,0>(ifrom, ito, thr);
|
||||||
if (vflag) eval<1,0,1>(ifrom, ito, thr);
|
} else {
|
||||||
else eval<1,0,0>(ifrom, ito, thr);
|
if (vflag) eval<1,1,0,1>(ifrom, ito, thr);
|
||||||
}
|
else eval<1,1,0,0>(ifrom, ito, thr);
|
||||||
|
}
|
||||||
|
} else eval<1,0,0,0>(ifrom, ito, thr);
|
||||||
} else {
|
} else {
|
||||||
eval<0,0,0>(ifrom, ito, thr);
|
if (evflag) {
|
||||||
|
if (eflag) {
|
||||||
|
if (vflag) eval<0,1,1,1>(ifrom, ito, thr);
|
||||||
|
else eval<0,1,1,0>(ifrom, ito, thr);
|
||||||
|
} else {
|
||||||
|
if (vflag) eval<0,1,0,1>(ifrom, ito, thr);
|
||||||
|
else eval<0,1,0,0>(ifrom, ito, thr);
|
||||||
|
}
|
||||||
|
} else eval<0,0,0,0>(ifrom, ito, thr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sync_threads();
|
sync_threads();
|
||||||
reduce_thr(this, eflag, vflag, thr, nproxy);
|
reduce_thr(this, eflag, vflag, thr, nproxy);
|
||||||
} // end of omp parallel region
|
} // end of omp parallel region
|
||||||
|
@ -157,7 +167,7 @@ void PairLJCutCoulPPPMTIP4POMP::compute(int eflag, int vflag)
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
template <int EVFLAG, int EFLAG, int VFLAG>
|
template <const int CTABLE, const int EVFLAG, const int EFLAG, const int VFLAG>
|
||||||
void PairLJCutCoulPPPMTIP4POMP::eval(int iifrom, int iito, ThrData * const thr)
|
void PairLJCutCoulPPPMTIP4POMP::eval(int iifrom, int iito, ThrData * const thr)
|
||||||
{
|
{
|
||||||
int i,j,ii,jj,jnum,itype,jtype,itable;
|
int i,j,ii,jj,jnum,itype,jtype,itable;
|
||||||
|
@ -185,6 +195,8 @@ void PairLJCutCoulPPPMTIP4POMP::eval(int iifrom, int iito, ThrData * const thr)
|
||||||
const double * const special_coul = force->special_coul;
|
const double * const special_coul = force->special_coul;
|
||||||
const double * const special_lj = force->special_lj;
|
const double * const special_lj = force->special_lj;
|
||||||
const double qqrd2e = force->qqrd2e;
|
const double qqrd2e = force->qqrd2e;
|
||||||
|
const double cut_coulsqplus = (cut_coul+2.0*qdist) * (cut_coul+2.0*qdist);
|
||||||
|
|
||||||
double fxtmp,fytmp,fztmp;
|
double fxtmp,fytmp,fztmp;
|
||||||
|
|
||||||
ilist = list->ilist;
|
ilist = list->ilist;
|
||||||
|
@ -221,34 +233,37 @@ void PairLJCutCoulPPPMTIP4POMP::eval(int iifrom, int iito, ThrData * const thr)
|
||||||
rsq = delx*delx + dely*dely + delz*delz;
|
rsq = delx*delx + dely*dely + delz*delz;
|
||||||
jtype = type[j];
|
jtype = type[j];
|
||||||
|
|
||||||
if (rsq < cutsq[itype][jtype]) {
|
// LJ interaction based on true rsq
|
||||||
|
|
||||||
|
if (rsq < cut_ljsq[itype][jtype]) {
|
||||||
r2inv = 1.0/rsq;
|
r2inv = 1.0/rsq;
|
||||||
if (rsq < cut_ljsq[itype][jtype]) {
|
r6inv = r2inv*r2inv*r2inv;
|
||||||
r6inv = r2inv*r2inv*r2inv;
|
forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
|
||||||
forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
|
forcelj *= factor_lj * r2inv;
|
||||||
forcelj *= factor_lj * r2inv;
|
|
||||||
|
|
||||||
fxtmp += delx*forcelj;
|
fxtmp += delx*forcelj;
|
||||||
fytmp += dely*forcelj;
|
fytmp += dely*forcelj;
|
||||||
fztmp += delz*forcelj;
|
fztmp += delz*forcelj;
|
||||||
f[j][0] -= delx*forcelj;
|
f[j][0] -= delx*forcelj;
|
||||||
f[j][1] -= dely*forcelj;
|
f[j][1] -= dely*forcelj;
|
||||||
f[j][2] -= delz*forcelj;
|
f[j][2] -= delz*forcelj;
|
||||||
|
|
||||||
if (EFLAG) {
|
if (EFLAG) {
|
||||||
evdwl = r6inv*(lj3[itype][jtype]*r6inv-lj4[itype][jtype]) -
|
evdwl = r6inv*(lj3[itype][jtype]*r6inv-lj4[itype][jtype]) -
|
||||||
offset[itype][jtype];
|
offset[itype][jtype];
|
||||||
evdwl *= factor_lj;
|
evdwl *= factor_lj;
|
||||||
} else evdwl = 0.0;
|
} else evdwl = 0.0;
|
||||||
|
|
||||||
if (EVFLAG) ev_tally_thr(this,i,j,nlocal, /* newton_pair = */ 1,
|
if (EVFLAG) ev_tally_thr(this,i,j,nlocal, /* newton_pair = */ 1,
|
||||||
evdwl,0.0,forcelj,delx,dely,delz,thr);
|
evdwl,0.0,forcelj,delx,dely,delz,thr);
|
||||||
}
|
}
|
||||||
|
|
||||||
// adjust rsq and delxyz for off-site O charge(s)
|
// adjust rsq and delxyz for off-site O charge(s),
|
||||||
|
// but only if they are within reach
|
||||||
|
|
||||||
if (itype == typeO || jtype == typeO) {
|
if (rsq < cut_coulsqplus) {
|
||||||
|
|
||||||
|
if (itype == typeO || jtype == typeO) {
|
||||||
x2 = mpos[j];
|
x2 = mpos[j];
|
||||||
jH1 = h1idx[j];
|
jH1 = h1idx[j];
|
||||||
jH2 = h2idx[j];
|
jH2 = h2idx[j];
|
||||||
|
@ -263,11 +278,11 @@ void PairLJCutCoulPPPMTIP4POMP::eval(int iifrom, int iito, ThrData * const thr)
|
||||||
rsq = delx*delx + dely*dely + delz*delz;
|
rsq = delx*delx + dely*dely + delz*delz;
|
||||||
}
|
}
|
||||||
|
|
||||||
// test current rsq against cutoff and compute Coulombic force
|
// Coulombic interaction based on modified rsq
|
||||||
|
|
||||||
if (rsq < cut_coulsq) {
|
if (rsq < cut_coulsq) {
|
||||||
r2inv = 1 / rsq;
|
r2inv = 1 / rsq;
|
||||||
if (!ncoultablebits || rsq <= tabinnersq) {
|
if (CTABLE || rsq <= tabinnersq) {
|
||||||
r = sqrt(rsq);
|
r = sqrt(rsq);
|
||||||
grij = g_ewald * r;
|
grij = g_ewald * r;
|
||||||
expm2 = exp(-grij*grij);
|
expm2 = exp(-grij*grij);
|
||||||
|
@ -322,40 +337,40 @@ void PairLJCutCoulPPPMTIP4POMP::eval(int iifrom, int iito, ThrData * const thr)
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
fdx = delx*cforce;
|
fdx = delx*cforce;
|
||||||
fdy = dely*cforce;
|
fdy = dely*cforce;
|
||||||
fdz = delz*cforce;
|
fdz = delz*cforce;
|
||||||
|
|
||||||
delxOM = x[i][0] - x1[0];
|
delxOM = x[i][0] - x1[0];
|
||||||
delyOM = x[i][1] - x1[1];
|
delyOM = x[i][1] - x1[1];
|
||||||
delzOM = x[i][2] - x1[2];
|
delzOM = x[i][2] - x1[2];
|
||||||
|
|
||||||
ddotf = (delxOM * fdx + delyOM * fdy + delzOM * fdz) /
|
ddotf = (delxOM * fdx + delyOM * fdy + delzOM * fdz) /
|
||||||
(qdist*qdist);
|
(qdist*qdist);
|
||||||
|
|
||||||
f1x = alpha * (fdx - ddotf * delxOM);
|
f1x = alpha * (fdx - ddotf * delxOM);
|
||||||
f1y = alpha * (fdy - ddotf * delyOM);
|
f1y = alpha * (fdy - ddotf * delyOM);
|
||||||
f1z = alpha * (fdz - ddotf * delzOM);
|
f1z = alpha * (fdz - ddotf * delzOM);
|
||||||
|
|
||||||
fOx = fdx - f1x;
|
fOx = fdx - f1x;
|
||||||
fOy = fdy - f1y;
|
fOy = fdy - f1y;
|
||||||
fOz = fdz - f1z;
|
fOz = fdz - f1z;
|
||||||
|
|
||||||
fHx = 0.5 * f1x;
|
fHx = 0.5 * f1x;
|
||||||
fHy = 0.5 * f1y;
|
fHy = 0.5 * f1y;
|
||||||
fHz = 0.5 * f1z;
|
fHz = 0.5 * f1z;
|
||||||
|
|
||||||
fxtmp += fOx;
|
fxtmp += fOx;
|
||||||
fytmp += fOy;
|
fytmp += fOy;
|
||||||
fztmp += fOz;
|
fztmp += fOz;
|
||||||
|
|
||||||
f[iH1][0] += fHx;
|
f[iH1][0] += fHx;
|
||||||
f[iH1][1] += fHy;
|
f[iH1][1] += fHy;
|
||||||
f[iH1][2] += fHz;
|
f[iH1][2] += fHz;
|
||||||
|
|
||||||
f[iH2][0] += fHx;
|
f[iH2][0] += fHx;
|
||||||
f[iH2][1] += fHy;
|
f[iH2][1] += fHy;
|
||||||
f[iH2][2] += fHz;
|
f[iH2][2] += fHz;
|
||||||
|
|
||||||
if (VFLAG) {
|
if (VFLAG) {
|
||||||
domain->closest_image(x[i],x[iH1],xH1);
|
domain->closest_image(x[i],x[iH1],xH1);
|
||||||
|
@ -399,32 +414,32 @@ void PairLJCutCoulPPPMTIP4POMP::eval(int iifrom, int iito, ThrData * const thr)
|
||||||
delyOM = x[j][1] - x2[1];
|
delyOM = x[j][1] - x2[1];
|
||||||
delzOM = x[j][2] - x2[2];
|
delzOM = x[j][2] - x2[2];
|
||||||
|
|
||||||
ddotf = (delxOM * fdx + delyOM * fdy + delzOM * fdz) /
|
ddotf = (delxOM * fdx + delyOM * fdy + delzOM * fdz) /
|
||||||
(qdist*qdist);
|
(qdist*qdist);
|
||||||
|
|
||||||
f1x = alpha * (fdx - ddotf * delxOM);
|
f1x = alpha * (fdx - ddotf * delxOM);
|
||||||
f1y = alpha * (fdy - ddotf * delyOM);
|
f1y = alpha * (fdy - ddotf * delyOM);
|
||||||
f1z = alpha * (fdz - ddotf * delzOM);
|
f1z = alpha * (fdz - ddotf * delzOM);
|
||||||
|
|
||||||
fOx = fdx - f1x;
|
fOx = fdx - f1x;
|
||||||
fOy = fdy - f1y;
|
fOy = fdy - f1y;
|
||||||
fOz = fdz - f1z;
|
fOz = fdz - f1z;
|
||||||
|
|
||||||
fHx = 0.5 * f1x;
|
fHx = 0.5 * f1x;
|
||||||
fHy = 0.5 * f1y;
|
fHy = 0.5 * f1y;
|
||||||
fHz = 0.5 * f1z;
|
fHz = 0.5 * f1z;
|
||||||
|
|
||||||
f[j][0] += fOx;
|
f[j][0] += fOx;
|
||||||
f[j][1] += fOy;
|
f[j][1] += fOy;
|
||||||
f[j][2] += fOz;
|
f[j][2] += fOz;
|
||||||
|
|
||||||
f[jH1][0] += fHx;
|
f[jH1][0] += fHx;
|
||||||
f[jH1][1] += fHy;
|
f[jH1][1] += fHy;
|
||||||
f[jH1][2] += fHz;
|
f[jH1][2] += fHz;
|
||||||
|
|
||||||
f[jH2][0] += fHx;
|
f[jH2][0] += fHx;
|
||||||
f[jH2][1] += fHy;
|
f[jH2][1] += fHy;
|
||||||
f[jH2][2] += fHz;
|
f[jH2][2] += fHz;
|
||||||
|
|
||||||
if (VFLAG) {
|
if (VFLAG) {
|
||||||
domain->closest_image(x[j],x[jH1],xH1);
|
domain->closest_image(x[j],x[jH1],xH1);
|
||||||
|
@ -444,7 +459,7 @@ void PairLJCutCoulPPPMTIP4POMP::eval(int iifrom, int iito, ThrData * const thr)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (EFLAG) {
|
if (EFLAG) {
|
||||||
if (!ncoultablebits || rsq <= tabinnersq)
|
if (CTABLE || rsq <= tabinnersq)
|
||||||
ecoul = prefactor*erfc;
|
ecoul = prefactor*erfc;
|
||||||
else {
|
else {
|
||||||
table = etable[itable] + fraction*detable[itable];
|
table = etable[itable] + fraction*detable[itable];
|
||||||
|
|
|
@ -48,10 +48,10 @@ class PairLJCutCoulPPPMTIP4POMP : public PairLJCutCoulLongTIP4P, public ThrOMP {
|
||||||
void find_M_permissive(int, int &, int &, double *);
|
void find_M_permissive(int, int &, int &, double *);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
template <int EVFLAG, int EFLAG, int NEWTON_PAIR>
|
template <const int, const int, const int, const int>
|
||||||
void eval(int ifrom, int ito, ThrData * const thr);
|
void eval(int ifrom, int ito, ThrData * const thr);
|
||||||
|
|
||||||
class PPPMProxy *kspace;
|
class PPPMTIP4PProxy *kspace;
|
||||||
int nproxy;
|
int nproxy;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue