git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@1452 f3b2605a-c512-4ea7-a41b-209d697bcdaa

This commit is contained in:
sjplimp 2008-01-31 20:44:01 +00:00
parent 19dbbe99f5
commit 8edbbe4369
1 changed files with 18 additions and 11 deletions

View File

@ -32,11 +32,11 @@ namespace LAMMPS_NS {
#define EWALD_F 1.12837917 #define EWALD_F 1.12837917
#define EWALD_P 0.3275911 #define EWALD_P 0.3275911
#define EWALD_A1 0.254829592 #define A1 0.254829592
#define EWALD_A2 -0.284496736 #define A2 -0.284496736
#define EWALD_A3 1.421413741 #define A3 1.421413741
#define EWALD_A4 -1.453152027 #define A4 -1.453152027
#define EWALD_A5 1.061405429 #define A5 1.061405429
#define MIN(a,b) ((a) < (b) ? (a) : (b)) #define MIN(a,b) ((a) < (b) ? (a) : (b))
#define MAX(a,b) ((a) > (b) ? (a) : (b)) #define MAX(a,b) ((a) > (b) ? (a) : (b))
@ -146,9 +146,7 @@ void PairLJCharmmCoulLongOpt::eval()
grij = g_ewald * r; grij = g_ewald * r;
expm2 = exp(-grij*grij); expm2 = exp(-grij*grij);
t = 1.0 / (1.0 + EWALD_P*grij); t = 1.0 / (1.0 + EWALD_P*grij);
erfc = t * erfc = t * (A1+t*(A2+t*(A3+t*(A4+t*A5)))) * expm2;
(EWALD_A1+t*(EWALD_A2+t*(EWALD_A3+t*(EWALD_A4+t*EWALD_A5)))) *
expm2;
prefactor = qqrd2e * tmp_coef3/r; prefactor = qqrd2e * tmp_coef3/r;
forcecoul = prefactor * (erfc + EWALD_F*grij*expm2); forcecoul = prefactor * (erfc + EWALD_F*grij*expm2);
} else { } else {
@ -232,9 +230,7 @@ void PairLJCharmmCoulLongOpt::eval()
grij = g_ewald * r; grij = g_ewald * r;
expm2 = exp(-grij*grij); expm2 = exp(-grij*grij);
t = 1.0 / (1.0 + EWALD_P*grij); t = 1.0 / (1.0 + EWALD_P*grij);
erfc = t * erfc = t * (A1+t*(A2+t*(A3+t*(A4+t*A5)))) * expm2;
(EWALD_A1+t*(EWALD_A2+t*(EWALD_A3+t*(EWALD_A4+t*EWALD_A5)))) *
expm2;
prefactor = qqrd2e * tmp_coef3/r; prefactor = qqrd2e * tmp_coef3/r;
forcecoul = prefactor * (erfc + EWALD_F*grij*expm2); forcecoul = prefactor * (erfc + EWALD_F*grij*expm2);
if (factor_coul < 1.0) { if (factor_coul < 1.0) {
@ -320,6 +316,17 @@ void PairLJCharmmCoulLongOpt::eval()
if (vflag_fdotr) virial_compute(); if (vflag_fdotr) virial_compute();
} }
#undef EWALD_F
#undef EWALD_P
#undef A1
#undef A2
#undef A3
#undef A4
#undef A5
#undef MIN
#undef MAX
} }