From f23a9950437a46be6ee8631fb69b341849c66895 Mon Sep 17 00:00:00 2001 From: Erik Lindahl Date: Wed, 8 Jul 2015 22:43:17 +0200 Subject: [PATCH] Fix a table generation bug for pme-shift The shift correction was not applied correctly to PME and PME-user tables, but a value of 0 was used instead. This will not have influenced any normal runs since the shift correction is applied directly (analytically) in the current kernels. In theory it might have resulted in 10^-5 relative errors at the cutoff that are only likely to be visible in double precision if you were (1) using PME-user electrostatics with custom tables, and (2) applying shift modifiers (switch is fine). This is not a setup we are testing anyway, and the PME-user options are likely to go soon. Change-Id: Ibd4d2388713879a6613938929edc2cba142b7c9b --- src/gromacs/mdlib/tables.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gromacs/mdlib/tables.c b/src/gromacs/mdlib/tables.c index a6f3b20225..c883d4afab 100644 --- a/src/gromacs/mdlib/tables.c +++ b/src/gromacs/mdlib/tables.c @@ -944,11 +944,11 @@ static void fill_table(t_tabledata *td, int tp, const t_forcerec *fr, break; case etabEwald: case etabEwaldSwitch: - Vtab = gmx_erfc(ewc*rc)/rc; + Vcut = gmx_erfc(ewc*rc)/rc; break; case etabEwaldUser: /* Only calculate minus the reciprocal space contribution */ - Vtab = -gmx_erf(ewc*rc)/rc; + Vcut = -gmx_erf(ewc*rc)/rc; break; case etabRF: case etabRF_ZERO: -- 2.22.0