a few more tweaks for consistency

This commit is contained in:
Axel Kohlmeyer
2023-01-06 09:03:00 -05:00
parent 92df9f1c71
commit 909bbcfdbd
4 changed files with 18 additions and 9 deletions

View File

@ -42,6 +42,9 @@ Examples
pair_coeff 1 1 "qi*qj/r" 4.0
pair_coeff 1 2 "lj+coul; lj=4.0*eps*((sig/r)^12 - (sig/r)^6); eps=1.0; sig=1.0; coul=qi*qj/r"
pair_style lepton/coul 2.5 pppm
kspace_style pppm 1.0e-4
pair_coeff 1 1 "qi*qj/r*erfc(alpha*r); alpha=1.067"
Description
"""""""""""

View File

@ -210,7 +210,13 @@ void PairLepton::coeff(int narg, char **arg)
utils::bounds(FLERR, arg[1], 1, atom->ntypes, jlo, jhi, error);
double cut_one = cut_global;
if (narg == 4) cut_one = utils::numeric(FLERR, arg[3], false, lmp);
if (narg == 4) {
if (pppmflag || ewaldflag || msmflag || dispersionflag || tip4pflag) {
error->all(FLERR, "Only a global cutoff is allowed with Kspace compatibility enabled");
} else {
cut_one = utils::numeric(FLERR, arg[3], false, lmp);
}
}
// remove whitespace and quotes from expression string and then
// check if the expression can be parsed and evaluated without error

View File

@ -144,16 +144,16 @@ template <int EVFLAG, int EFLAG, int NEWTON_PAIR> void PairLeptonCoul::eval()
f[j][2] -= delz * fpair;
}
double evdwl = 0.0;
double ecoul = 0.0;
if (EFLAG) {
pairpot[idx].getVariableReference("r") = r;
if (have_q[idx].first) pairpot[idx].getVariableReference("qi") = q2e * q[i];
if (have_q[idx].second) pairpot[idx].getVariableReference("qj") = q2e * q[j];
evdwl = pairpot[idx].evaluate();
evdwl *= factor_coul;
ecoul = pairpot[idx].evaluate();
ecoul *= factor_coul;
}
if (EVFLAG) ev_tally(i, j, nlocal, NEWTON_PAIR, 0.0, evdwl, fpair, delx, dely, delz);
if (EVFLAG) ev_tally(i, j, nlocal, NEWTON_PAIR, 0.0, ecoul, fpair, delx, dely, delz);
}
}
f[i][0] += fxtmp;

View File

@ -166,17 +166,17 @@ void PairLeptonCoulOMP::eval(int iifrom, int iito, ThrData *const thr)
f[j].z -= delz * fpair;
}
double evdwl = 0.0;
double ecoul = 0.0;
if (EFLAG) {
pairpot[idx].getVariableReference("r") = r;
if (have_q[idx].first) pairpot[idx].getVariableReference("qi") = q2e * q[i];
if (have_q[idx].second) pairpot[idx].getVariableReference("qj") = q2e * q[j];
evdwl = pairpot[idx].evaluate();
evdwl *= factor_coul;
ecoul = pairpot[idx].evaluate();
ecoul *= factor_coul;
}
if (EVFLAG)
ev_tally_thr(this, i, j, nlocal, NEWTON_PAIR, evdwl, 0.0, fpair, delx, dely, delz, thr);
ev_tally_thr(this, i, j, nlocal, NEWTON_PAIR, 0.0, ecoul, fpair, delx, dely, delz, thr);
}
}
f[i].x += fxtmp;