avoid division by zero when using cutoff 0.0 with pair_modify shift yes
This commit is contained in:
@ -391,7 +391,7 @@ double PairGayBerne::init_one(int i, int j)
|
||||
lj3[i][j] = 4.0 * epsilon[i][j] * pow(sigma[i][j],12.0);
|
||||
lj4[i][j] = 4.0 * epsilon[i][j] * pow(sigma[i][j],6.0);
|
||||
|
||||
if (offset_flag) {
|
||||
if (offset_flag && (cut[i][j] > 0.0)) {
|
||||
double ratio = sigma[i][j] / cut[i][j];
|
||||
offset[i][j] = 4.0 * epsilon[i][j] * (pow(ratio,12.0) - pow(ratio,6.0));
|
||||
} else offset[i][j] = 0.0;
|
||||
|
||||
@ -391,7 +391,7 @@ double PairRESquared::init_one(int i, int j)
|
||||
lj3[i][j] = 4.0 * epsilon[i][j] * pow(sigma[i][j],12.0);
|
||||
lj4[i][j] = 4.0 * epsilon[i][j] * pow(sigma[i][j],6.0);
|
||||
|
||||
if (offset_flag) {
|
||||
if (offset_flag && (cut[i][j] > 0.0)) {
|
||||
double ratio = sigma[i][j] / cut[i][j];
|
||||
offset[i][j] = 4.0 * epsilon[i][j] * (pow(ratio,12.0) - pow(ratio,6.0));
|
||||
} else offset[i][j] = 0.0;
|
||||
|
||||
@ -235,7 +235,7 @@ double PairLJClass2::init_one(int i, int j)
|
||||
lj3[i][j] = 2.0 * epsilon[i][j] * pow(sigma[i][j],9.0);
|
||||
lj4[i][j] = 3.0 * epsilon[i][j] * pow(sigma[i][j],6.0);
|
||||
|
||||
if (offset_flag) {
|
||||
if (offset_flag && (cut[i][j] > 0.0)) {
|
||||
double ratio = sigma[i][j] / cut[i][j];
|
||||
offset[i][j] = epsilon[i][j] * (2.0*pow(ratio,9.0) - 3.0*pow(ratio,6.0));
|
||||
} else offset[i][j] = 0.0;
|
||||
|
||||
@ -286,7 +286,7 @@ double PairLJClass2CoulCut::init_one(int i, int j)
|
||||
lj3[i][j] = 2.0 * epsilon[i][j] * pow(sigma[i][j],9.0);
|
||||
lj4[i][j] = 3.0 * epsilon[i][j] * pow(sigma[i][j],6.0);
|
||||
|
||||
if (offset_flag) {
|
||||
if (offset_flag && (cut_lj[i][j] > 0.0)) {
|
||||
double ratio = sigma[i][j] / cut_lj[i][j];
|
||||
offset[i][j] = epsilon[i][j] * (2.0*pow(ratio,9.0) - 3.0*pow(ratio,6.0));
|
||||
} else offset[i][j] = 0.0;
|
||||
|
||||
@ -329,7 +329,7 @@ double PairLJClass2CoulLong::init_one(int i, int j)
|
||||
lj3[i][j] = 2.0 * epsilon[i][j] * pow(sigma[i][j],9.0);
|
||||
lj4[i][j] = 3.0 * epsilon[i][j] * pow(sigma[i][j],6.0);
|
||||
|
||||
if (offset_flag) {
|
||||
if (offset_flag && (cut_lj[i][j] > 0.0)) {
|
||||
double ratio = sigma[i][j] / cut_lj[i][j];
|
||||
offset[i][j] = epsilon[i][j] * (2.0*pow(ratio,9.0) - 3.0*pow(ratio,6.0));
|
||||
} else offset[i][j] = 0.0;
|
||||
|
||||
@ -354,7 +354,7 @@ double PairColloid::init_one(int i, int j)
|
||||
lj4[j][i] = lj4[i][j] = 4.0 * epsilon * sigma6[i][j];
|
||||
|
||||
offset[j][i] = offset[i][j] = 0.0;
|
||||
if (offset_flag) {
|
||||
if (offset_flag && (cut[i][j] > 0.0)) {
|
||||
double tmp;
|
||||
offset[j][i] = offset[i][j] =
|
||||
single(0,0,i,j,cut[i][j]*cut[i][j],0.0,1.0,tmp);
|
||||
|
||||
@ -147,7 +147,7 @@ double PairYukawaColloid::init_one(int i, int j)
|
||||
cut[i][j] = mix_distance(cut[i][i],cut[j][j]);
|
||||
}
|
||||
|
||||
if (offset_flag) {
|
||||
if (offset_flag && (kappa != 0.0)) {
|
||||
double screening = exp(-kappa * (cut[i][j] - (rad[i]+rad[j])));
|
||||
offset[i][j] = a[i][j]/kappa * screening;
|
||||
} else offset[i][j] = 0.0;
|
||||
|
||||
@ -387,7 +387,7 @@ double PairLJCutDipoleCut::init_one(int i, int j)
|
||||
lj3[i][j] = 4.0 * epsilon[i][j] * pow(sigma[i][j],12.0);
|
||||
lj4[i][j] = 4.0 * epsilon[i][j] * pow(sigma[i][j],6.0);
|
||||
|
||||
if (offset_flag) {
|
||||
if (offset_flag && (cut_lj[i][j] > 0.0)) {
|
||||
double ratio = sigma[i][j] / cut_lj[i][j];
|
||||
offset[i][j] = 4.0 * epsilon[i][j] * (pow(ratio,12.0) - pow(ratio,6.0));
|
||||
} else offset[i][j] = 0.0;
|
||||
|
||||
@ -420,7 +420,7 @@ double PairLJCutDipoleLong::init_one(int i, int j)
|
||||
lj3[i][j] = 4.0 * epsilon[i][j] * pow(sigma[i][j],12.0);
|
||||
lj4[i][j] = 4.0 * epsilon[i][j] * pow(sigma[i][j],6.0);
|
||||
|
||||
if (offset_flag) {
|
||||
if (offset_flag && (cut_lj[i][j] > 0.0)) {
|
||||
double ratio = sigma[i][j] / cut_lj[i][j];
|
||||
offset[i][j] = 4.0 * epsilon[i][j] * (pow(ratio,12.0) - pow(ratio,6.0));
|
||||
} else offset[i][j] = 0.0;
|
||||
|
||||
@ -314,7 +314,7 @@ double PairLJLongDipoleLong::init_one(int i, int j)
|
||||
//if (cut_respa && MIN(cut_lj[i][j],cut_coul) < cut_respa[3])
|
||||
//error->all(FLERR,"Pair cutoff < Respa interior cutoff");
|
||||
|
||||
if (offset_flag) {
|
||||
if (offset_flag && (cut_lj[i][j] > 0.0)) {
|
||||
double ratio = sigma[i][j] / cut_lj[i][j];
|
||||
offset[i][j] = 4.0 * epsilon[i][j] * (pow(ratio,12.0) - pow(ratio,6.0));
|
||||
} else offset[i][j] = 0.0;
|
||||
|
||||
@ -311,7 +311,7 @@ double PairBornCoulLong::init_one(int i, int j)
|
||||
born2[i][j] = 6.0*c[i][j];
|
||||
born3[i][j] = 8.0*d[i][j];
|
||||
|
||||
if (offset_flag) {
|
||||
if (offset_flag && (cut_lj[i][j] > 0.0)) {
|
||||
double rexp = exp((sigma[i][j]-cut_lj[i][j])*rhoinv[i][j]);
|
||||
offset[i][j] = a[i][j]*rexp - c[i][j]/pow(cut_lj[i][j],6.0) +
|
||||
d[i][j]/pow(cut_lj[i][j],8.0);
|
||||
|
||||
@ -297,7 +297,7 @@ double PairBuckCoulLong::init_one(int i, int j)
|
||||
buck1[i][j] = a[i][j]/rho[i][j];
|
||||
buck2[i][j] = 6.0*c[i][j];
|
||||
|
||||
if (offset_flag) {
|
||||
if (offset_flag && (cut_lj[i][j] > 0.0)) {
|
||||
double rexp = exp(-cut_lj[i][j]/rho[i][j]);
|
||||
offset[i][j] = a[i][j]*rexp - c[i][j]/pow(cut_lj[i][j],6.0);
|
||||
} else offset[i][j] = 0.0;
|
||||
|
||||
@ -330,7 +330,7 @@ double PairBuckLongCoulLong::init_one(int i, int j)
|
||||
if (cut_respa && MIN(cut_buck[i][j],cut_coul) < cut_respa[3])
|
||||
error->all(FLERR,"Pair cutoff < Respa interior cutoff");
|
||||
|
||||
if (offset_flag) {
|
||||
if (offset_flag && (cut_buck[i][j] > 0.0)) {
|
||||
double rexp = exp(-cut_buck[i][j]/buck_rho[i][j]);
|
||||
offset[i][j] = buck_a[i][j]*rexp - buck_c[i][j]/pow(cut_buck[i][j],6.0);
|
||||
} else offset[i][j] = 0.0;
|
||||
|
||||
@ -743,7 +743,7 @@ double PairLJCutCoulLong::init_one(int i, int j)
|
||||
lj3[i][j] = 4.0 * epsilon[i][j] * pow(sigma[i][j],12.0);
|
||||
lj4[i][j] = 4.0 * epsilon[i][j] * pow(sigma[i][j],6.0);
|
||||
|
||||
if (offset_flag) {
|
||||
if (offset_flag && (cut_lj[i][j] > 0.0)) {
|
||||
double ratio = sigma[i][j] / cut_lj[i][j];
|
||||
offset[i][j] = 4.0 * epsilon[i][j] * (pow(ratio,12.0) - pow(ratio,6.0));
|
||||
} else offset[i][j] = 0.0;
|
||||
|
||||
@ -333,7 +333,7 @@ double PairLJLongCoulLong::init_one(int i, int j)
|
||||
if (cut_respa && MIN(cut_lj[i][j],cut_coul) < cut_respa[3])
|
||||
error->all(FLERR,"Pair cutoff < Respa interior cutoff");
|
||||
|
||||
if (offset_flag) {
|
||||
if (offset_flag && (cut_lj[i][j] > 0.0)) {
|
||||
double ratio = sigma[i][j] / cut_lj[i][j];
|
||||
offset[i][j] = 4.0 * epsilon[i][j] * (pow(ratio,12.0) - pow(ratio,6.0));
|
||||
} else offset[i][j] = 0.0;
|
||||
|
||||
@ -243,7 +243,7 @@ double PairNMCut::init_one(int i, int j)
|
||||
r0n[i][j] = pow(r0[i][j],nn[i][j]);
|
||||
r0m[i][j] = pow(r0[i][j],mm[i][j]);
|
||||
|
||||
if (offset_flag) {
|
||||
if (offset_flag && (cut[i][j] > 0.0)) {
|
||||
offset[i][j] = e0nm[i][j] *
|
||||
((mm[i][j]*r0n[i][j] / pow(cut[i][j],nn[i][j])) -
|
||||
(nn[i][j]*r0m[i][j] / pow(cut[i][j],mm[i][j])));
|
||||
|
||||
@ -291,7 +291,7 @@ double PairNMCutCoulCut::init_one(int i, int j)
|
||||
r0n[i][j] = pow(r0[i][j],nn[i][j]);
|
||||
r0m[i][j] = pow(r0[i][j],mm[i][j]);
|
||||
|
||||
if (offset_flag) {
|
||||
if (offset_flag && (cut_lj[i][j] > 0.0)) {
|
||||
offset[i][j] = e0nm[i][j] *
|
||||
((mm[i][j]*r0n[i][j] / pow(cut_lj[i][j],nn[i][j])) -
|
||||
(nn[i][j]*r0m[i][j] / pow(cut_lj[i][j],mm[i][j])));
|
||||
|
||||
@ -339,7 +339,7 @@ double PairNMCutCoulLong::init_one(int i, int j)
|
||||
r0n[i][j] = pow(r0[i][j],nn[i][j]);
|
||||
r0m[i][j] = pow(r0[i][j],mm[i][j]);
|
||||
|
||||
if (offset_flag) {
|
||||
if (offset_flag && (cut_lj[i][j] > 0.0)) {
|
||||
offset[i][j] = e0nm[i][j] *
|
||||
((mm[i][j]*r0n[i][j] / pow(cut_lj[i][j],nn[i][j])) -
|
||||
(nn[i][j]*r0m[i][j] / pow(cut_lj[i][j],mm[i][j])));
|
||||
|
||||
@ -531,7 +531,7 @@ double PairLJCutTIP4PCut::init_one(int i, int j)
|
||||
lj3[i][j] = 4.0 * epsilon[i][j] * pow(sigma[i][j],12.0);
|
||||
lj4[i][j] = 4.0 * epsilon[i][j] * pow(sigma[i][j],6.0);
|
||||
|
||||
if (offset_flag) {
|
||||
if (offset_flag && (cut_lj[i][j] > 0.0)) {
|
||||
double ratio = sigma[i][j] / cut_lj[i][j];
|
||||
offset[i][j] = 4.0 * epsilon[i][j] * (pow(ratio,12.0) - pow(ratio,6.0));
|
||||
} else offset[i][j] = 0.0;
|
||||
|
||||
@ -311,7 +311,7 @@ double PairLJSDK::init_one(int i, int j)
|
||||
lj3[i][j] = lj_prefact[ljt] * epsilon[i][j] * pow(sigma[i][j],lj_pow1[ljt]);
|
||||
lj4[i][j] = lj_prefact[ljt] * epsilon[i][j] * pow(sigma[i][j],lj_pow2[ljt]);
|
||||
|
||||
if (offset_flag) {
|
||||
if (offset_flag && (cut[i][j] > 0.0)) {
|
||||
double ratio = sigma[i][j] / cut[i][j];
|
||||
offset[i][j] = lj_prefact[ljt] * epsilon[i][j] * (pow(ratio,lj_pow1[ljt]) - pow(ratio,lj_pow2[ljt]));
|
||||
} else offset[i][j] = 0.0;
|
||||
|
||||
@ -401,7 +401,7 @@ double PairLJSDKCoulLong::init_one(int i, int j)
|
||||
lj3[i][j] = lj_prefact[ljt] * epsilon[i][j] * pow(sigma[i][j],lj_pow1[ljt]);
|
||||
lj4[i][j] = lj_prefact[ljt] * epsilon[i][j] * pow(sigma[i][j],lj_pow2[ljt]);
|
||||
|
||||
if (offset_flag) {
|
||||
if (offset_flag && (cut_lj[i][j] > 0.0)) {
|
||||
double ratio = sigma[i][j] / cut_lj[i][j];
|
||||
offset[i][j] = lj_prefact[ljt] * epsilon[i][j] *
|
||||
(pow(ratio,lj_pow1[ljt]) - pow(ratio,lj_pow2[ljt]));
|
||||
|
||||
@ -994,7 +994,7 @@ double PairLJCharmmCoulLongSoft::single(int i, int j, int itype, int jtype,
|
||||
|
||||
if (rsq < cut_ljsq) {
|
||||
philj = lj1[itype][jtype] * 4.0 * epsilon[itype][jtype] *
|
||||
(1.0/(denlj*denlj) - 1.0/denlj) - offset[itype][jtype];
|
||||
(1.0/(denlj*denlj) - 1.0/denlj);
|
||||
if (rsq > cut_lj_innersq) {
|
||||
switch1 = (cut_ljsq-rsq) * (cut_ljsq-rsq) *
|
||||
(cut_ljsq + 2.0*rsq - 3.0*cut_lj_innersq) / denom_lj;
|
||||
|
||||
@ -236,6 +236,8 @@ void PairLJCutCoulCutSoft::coeff(int narg, char **arg)
|
||||
double epsilon_one = force->numeric(FLERR,arg[2]);
|
||||
double sigma_one = force->numeric(FLERR,arg[3]);
|
||||
double lambda_one = force->numeric(FLERR,arg[4]);
|
||||
if (sigma_one <= 0.0)
|
||||
error->all(FLERR,"Incorrect args for pair coefficients");
|
||||
|
||||
double cut_lj_one = cut_lj_global;
|
||||
double cut_coul_one = cut_coul_global;
|
||||
@ -296,7 +298,7 @@ double PairLJCutCoulCutSoft::init_one(int i, int j)
|
||||
lj3[i][j] = alphalj * (1.0 - lambda[i][j])*(1.0 - lambda[i][j]);
|
||||
lj4[i][j] = alphac * (1.0 - lambda[i][j])*(1.0 - lambda[i][j]);
|
||||
|
||||
if (offset_flag) {
|
||||
if (offset_flag && (cut_lj[i][j] > 0.0)) {
|
||||
double denlj = lj3[i][j] + pow(cut_lj[i][j] / sigma[i][j], 6.0);
|
||||
offset[i][j] = lj1[i][j] * 4.0 * epsilon[i][j] * (1.0/(denlj*denlj) - 1.0/denlj);
|
||||
} else offset[i][j] = 0.0;
|
||||
|
||||
@ -604,6 +604,8 @@ void PairLJCutCoulLongSoft::coeff(int narg, char **arg)
|
||||
double epsilon_one = force->numeric(FLERR,arg[2]);
|
||||
double sigma_one = force->numeric(FLERR,arg[3]);
|
||||
double lambda_one = force->numeric(FLERR,arg[4]);
|
||||
if (sigma_one <= 0.0)
|
||||
error->all(FLERR,"Incorrect args for pair coefficients");
|
||||
|
||||
double cut_lj_one = cut_lj_global;
|
||||
if (narg == 6) cut_lj_one = force->numeric(FLERR,arg[5]);
|
||||
@ -723,7 +725,7 @@ double PairLJCutCoulLongSoft::init_one(int i, int j)
|
||||
lj3[i][j] = alphalj * (1.0 - lambda[i][j])*(1.0 - lambda[i][j]);
|
||||
lj4[i][j] = alphac * (1.0 - lambda[i][j])*(1.0 - lambda[i][j]);
|
||||
|
||||
if (offset_flag) {
|
||||
if (offset_flag && (cut_lj[i][j] > 0.0)) {
|
||||
double denlj = lj3[i][j] + pow(cut_lj[i][j] / sigma[i][j], 6.0);
|
||||
offset[i][j] = lj1[i][j] * 4.0 * epsilon[i][j] * (1.0/(denlj*denlj) - 1.0/denlj);
|
||||
} else offset[i][j] = 0.0;
|
||||
|
||||
@ -484,6 +484,8 @@ void PairLJCutSoft::coeff(int narg, char **arg)
|
||||
double epsilon_one = force->numeric(FLERR,arg[2]);
|
||||
double sigma_one = force->numeric(FLERR,arg[3]);
|
||||
double lambda_one = force->numeric(FLERR,arg[4]);
|
||||
if (sigma_one <= 0.0)
|
||||
error->all(FLERR,"Incorrect args for pair coefficients");
|
||||
|
||||
double cut_one = cut_global;
|
||||
if (narg == 6) cut_one = force->numeric(FLERR,arg[5]);
|
||||
@ -584,7 +586,7 @@ double PairLJCutSoft::init_one(int i, int j)
|
||||
lj2[i][j] = pow(sigma[i][j], 6.0);
|
||||
lj3[i][j] = alphalj * (1.0 - lambda[i][j])*(1.0 - lambda[i][j]);
|
||||
|
||||
if (offset_flag) {
|
||||
if (offset_flag && (cut[i][j] > 0.0)) {
|
||||
double denlj = lj3[i][j] + pow(cut[i][j] / sigma[i][j], 6.0);
|
||||
offset[i][j] = lj1[i][j] * 4.0 * epsilon[i][j] * (1.0/(denlj*denlj) - 1.0/denlj);
|
||||
} else offset[i][j] = 0.0;
|
||||
|
||||
@ -259,7 +259,7 @@ double PairBuckMDF::init_one(int i, int j)
|
||||
buck1[i][j] = a[i][j]/rho[i][j];
|
||||
buck2[i][j] = 6.0*c[i][j];
|
||||
|
||||
if (offset_flag) {
|
||||
if (offset_flag && (cut[i][j] > 0.0)) {
|
||||
double rexp = exp(-cut[i][j]/rho[i][j]);
|
||||
offset[i][j] = a[i][j]*rexp - c[i][j]/pow(cut[i][j],6.0);
|
||||
} else offset[i][j] = 0.0;
|
||||
|
||||
@ -235,7 +235,7 @@ double PairCoulDiel::init_one(int i, int j)
|
||||
double *q = atom->q;
|
||||
double qqrd2e = force->qqrd2e;
|
||||
|
||||
if (offset_flag) {
|
||||
if (offset_flag && (cut[i][j] > 0.0)) {
|
||||
double rarg = (cut[i][j]-rme[i][j])/sigmae[i][j];
|
||||
double epsr=a_eps+b_eps*tanh(rarg);
|
||||
offset[i][j] = qqrd2e*q[i]*q[j]*((eps_s/epsr) -1.)/cut[i][j];
|
||||
|
||||
@ -196,6 +196,9 @@ void PairGaussCut::coeff(int narg, char **arg)
|
||||
double hgauss_one = force->numeric(FLERR,arg[2]);
|
||||
double rmh_one = force->numeric(FLERR,arg[3]);
|
||||
double sigmah_one = force->numeric(FLERR,arg[4]);
|
||||
if (sigmah_one <= 0.0)
|
||||
error->all(FLERR,"Incorrect args for pair coefficients");
|
||||
|
||||
|
||||
double cut_one = cut_global;
|
||||
if (narg == 6) cut_one = force->numeric(FLERR,arg[5]);
|
||||
|
||||
@ -53,7 +53,7 @@ PairKolmogorovCrespiZ::PairKolmogorovCrespiZ(LAMMPS *lmp) : Pair(lmp)
|
||||
map = NULL;
|
||||
|
||||
// always compute energy offset
|
||||
offset_flag = true;
|
||||
offset_flag = 1;
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
@ -285,7 +285,7 @@ double PairKolmogorovCrespiZ::init_one(int i, int j)
|
||||
{
|
||||
if (setflag[i][j] == 0) error->all(FLERR,"All pair coeffs are not set");
|
||||
|
||||
if (offset_flag) {
|
||||
if (offset_flag && (cut[i][j] > 0.0)) {
|
||||
int iparam_ij = elem2param[map[i]][map[j]];
|
||||
Param& p = params[iparam_ij];
|
||||
offset[i][j] = -p.A*pow(p.z0/cut[i][j],6);
|
||||
|
||||
@ -243,7 +243,7 @@ double PairBorn::init_one(int i, int j)
|
||||
born2[i][j] = 6.0*c[i][j];
|
||||
born3[i][j] = 8.0*d[i][j];
|
||||
|
||||
if (offset_flag) {
|
||||
if (offset_flag && (cut[i][j] > 0.0)) {
|
||||
double rexp = exp((sigma[i][j]-cut[i][j])*rhoinv[i][j]);
|
||||
offset[i][j] = a[i][j]*rexp - c[i][j]/pow(cut[i][j],6.0) +
|
||||
d[i][j]/pow(cut[i][j],8.0);
|
||||
|
||||
@ -306,7 +306,7 @@ double PairBornCoulDSF::init_one(int i, int j)
|
||||
born2[i][j] = 6.0*c[i][j];
|
||||
born3[i][j] = 8.0*d[i][j];
|
||||
|
||||
if (offset_flag) {
|
||||
if (offset_flag && (cut_lj[i][j] > 0.0)) {
|
||||
double rexp = exp((sigma[i][j]-cut_lj[i][j])*rhoinv[i][j]);
|
||||
offset[i][j] = a[i][j]*rexp - c[i][j]/pow(cut_lj[i][j],6.0)
|
||||
+ d[i][j]/pow(cut_lj[i][j],8.0);
|
||||
|
||||
@ -305,7 +305,7 @@ double PairBornCoulWolf::init_one(int i, int j)
|
||||
born2[i][j] = 6.0*c[i][j];
|
||||
born3[i][j] = 8.0*d[i][j];
|
||||
|
||||
if (offset_flag) {
|
||||
if (offset_flag && (cut_lj[i][j] > 0.0)) {
|
||||
double rexp = exp((sigma[i][j]-cut_lj[i][j])*rhoinv[i][j]);
|
||||
offset[i][j] = a[i][j]*rexp - c[i][j]/pow(cut_lj[i][j],6.0)
|
||||
+ d[i][j]/pow(cut_lj[i][j],8.0);
|
||||
|
||||
@ -230,7 +230,7 @@ double PairBuck::init_one(int i, int j)
|
||||
buck1[i][j] = a[i][j]/rho[i][j];
|
||||
buck2[i][j] = 6.0*c[i][j];
|
||||
|
||||
if (offset_flag) {
|
||||
if (offset_flag && (cut[i][j] > 0.0)) {
|
||||
double rexp = exp(-cut[i][j]/rho[i][j]);
|
||||
offset[i][j] = a[i][j]*rexp - c[i][j]/pow(cut[i][j],6.0);
|
||||
} else offset[i][j] = 0.0;
|
||||
|
||||
@ -281,7 +281,7 @@ double PairBuckCoulCut::init_one(int i, int j)
|
||||
buck1[i][j] = a[i][j]/rho[i][j];
|
||||
buck2[i][j] = 6.0*c[i][j];
|
||||
|
||||
if (offset_flag) {
|
||||
if (offset_flag && (cut_lj[i][j] > 0.0)) {
|
||||
double rexp = exp(-cut_lj[i][j]/rho[i][j]);
|
||||
offset[i][j] = a[i][j]*rexp - c[i][j]/pow(cut_lj[i][j],6.0);
|
||||
} else offset[i][j] = 0.0;
|
||||
|
||||
@ -557,7 +557,7 @@ double PairLJ96Cut::init_one(int i, int j)
|
||||
lj3[i][j] = 4.0 * epsilon[i][j] * pow(sigma[i][j],9.0);
|
||||
lj4[i][j] = 4.0 * epsilon[i][j] * pow(sigma[i][j],6.0);
|
||||
|
||||
if (offset_flag) {
|
||||
if (offset_flag && (cut[i][j] > 0.0)) {
|
||||
double ratio = sigma[i][j] / cut[i][j];
|
||||
offset[i][j] = 4.0 * epsilon[i][j] * (pow(ratio,9.0) - pow(ratio,6.0));
|
||||
} else offset[i][j] = 0.0;
|
||||
|
||||
@ -551,7 +551,7 @@ double PairLJCut::init_one(int i, int j)
|
||||
lj3[i][j] = 4.0 * epsilon[i][j] * pow(sigma[i][j],12.0);
|
||||
lj4[i][j] = 4.0 * epsilon[i][j] * pow(sigma[i][j],6.0);
|
||||
|
||||
if (offset_flag) {
|
||||
if (offset_flag && (cut[i][j] > 0.0)) {
|
||||
double ratio = sigma[i][j] / cut[i][j];
|
||||
offset[i][j] = 4.0 * epsilon[i][j] * (pow(ratio,12.0) - pow(ratio,6.0));
|
||||
} else offset[i][j] = 0.0;
|
||||
|
||||
@ -278,7 +278,7 @@ double PairLJCutCoulCut::init_one(int i, int j)
|
||||
lj3[i][j] = 4.0 * epsilon[i][j] * pow(sigma[i][j],12.0);
|
||||
lj4[i][j] = 4.0 * epsilon[i][j] * pow(sigma[i][j],6.0);
|
||||
|
||||
if (offset_flag) {
|
||||
if (offset_flag && (cut_lj[i][j] > 0.0)) {
|
||||
double ratio = sigma[i][j] / cut_lj[i][j];
|
||||
offset[i][j] = 4.0 * epsilon[i][j] * (pow(ratio,12.0) - pow(ratio,6.0));
|
||||
} else offset[i][j] = 0.0;
|
||||
|
||||
@ -303,7 +303,7 @@ double PairLJCutCoulDSF::init_one(int i, int j)
|
||||
lj3[i][j] = 4.0 * epsilon[i][j] * pow(sigma[i][j],12.0);
|
||||
lj4[i][j] = 4.0 * epsilon[i][j] * pow(sigma[i][j],6.0);
|
||||
|
||||
if (offset_flag) {
|
||||
if (offset_flag && (cut_lj[i][j] > 0.0)) {
|
||||
double ratio = sigma[i][j] / cut_lj[i][j];
|
||||
offset[i][j] = 4.0 * epsilon[i][j] * (pow(ratio,12.0) - pow(ratio,6.0));
|
||||
} else offset[i][j] = 0.0;
|
||||
|
||||
@ -240,7 +240,7 @@ double PairLJExpand::init_one(int i, int j)
|
||||
lj3[i][j] = 4.0 * epsilon[i][j] * pow(sigma[i][j],12.0);
|
||||
lj4[i][j] = 4.0 * epsilon[i][j] * pow(sigma[i][j],6.0);
|
||||
|
||||
if (offset_flag) {
|
||||
if (offset_flag && (cut[i][j] > 0.0)) {
|
||||
double ratio = sigma[i][j] / cut[i][j];
|
||||
offset[i][j] = 4.0 * epsilon[i][j] * (pow(ratio,12.0) - pow(ratio,6.0));
|
||||
} else offset[i][j] = 0.0;
|
||||
|
||||
@ -575,7 +575,7 @@ double PairMIECut::init_one(int i, int j)
|
||||
mie3[i][j] = Cmie[i][j] * epsilon[i][j] * pow(sigma[i][j],gamR[i][j]);
|
||||
mie4[i][j] = Cmie[i][j] * epsilon[i][j] * pow(sigma[i][j],gamA[i][j]);
|
||||
|
||||
if (offset_flag) {
|
||||
if (offset_flag && (cut[i][j] > 0.0)) {
|
||||
double ratio = sigma[i][j] / cut[i][j];
|
||||
offset[i][j] = Cmie[i][j] * epsilon[i][j] *
|
||||
(pow(ratio,gamR[i][j]) - pow(ratio,gamA[i][j]));
|
||||
|
||||
@ -210,7 +210,7 @@ double PairYukawa::init_one(int i, int j)
|
||||
cut[i][j] = mix_distance(cut[i][i],cut[j][j]);
|
||||
}
|
||||
|
||||
if (offset_flag) {
|
||||
if (offset_flag && (cut[i][j] > 0.0)) {
|
||||
double screening = exp(-kappa * cut[i][j]);
|
||||
offset[i][j] = a[i][j] * screening / cut[i][j];
|
||||
} else offset[i][j] = 0.0;
|
||||
|
||||
Reference in New Issue
Block a user