Skip to content

Commit

Permalink
fix bug in single function of buck/long/coul/long
Browse files Browse the repository at this point in the history
  • Loading branch information
akohlmey committed Aug 6, 2020
1 parent ad71475 commit fefed73
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/KSPACE/pair_buck_long_coul_long.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -995,8 +995,7 @@ double PairBuckLongCoulLong::single(int i, int j, int itype, int jtype,
f = s*(1.0-factor_coul)/r; s *= g_ewald*exp(-x*x);
force_coul = (t *= ((((t*A5+A4)*t+A3)*t+A2)*t+A1)*s/x)+EWALD_F*s-f;
eng += t-f;
}
else { // table real space
} else { // table real space
union_int_float_t t;
t.f = rsq;
const int k = (t.i & ncoulmask) >> ncoulshiftbits;
Expand All @@ -1014,11 +1013,10 @@ double PairBuckLongCoulLong::single(int i, int j, int itype, int jtype,
double x2 = g2*rsq, a2 = 1.0/x2, t = r6inv*(1.0-factor_buck);
x2 = a2*exp(-x2)*buck_c[itype][jtype];
force_buck = buck1[itype][jtype]*r*expr-
g8*(((6.0*a2+6.0)*a2+3.0)*a2+a2)*x2*rsq+t*buck2[itype][jtype];
g8*(((6.0*a2+6.0)*a2+3.0)*a2+1.0)*x2*rsq+t*buck2[itype][jtype];
eng += buck_a[itype][jtype]*expr-
g6*((a2+1.0)*a2+0.5)*x2+t*buck_c[itype][jtype];
}
else { // cut
} else { // cut
force_buck =
buck1[itype][jtype]*r*expr-factor_buck*buck_c[itype][jtype]*r6inv;
eng += buck_a[itype][jtype]*expr-
Expand Down

0 comments on commit fefed73

Please sign in to comment.