From 79f730b0edb541921ec3cc43004a86882ca79017 Mon Sep 17 00:00:00 2001 From: Berk Hess Date: Mon, 9 Jun 2014 15:12:12 +0200 Subject: [PATCH] Removed rounding issue in nbnxn Ewald table The nbnxn Ewald table could got the spacing dx passed as a real. Changing this to double improves the accuracy of the single precision table by two orders of magnitude, because rounding errors are avoided. Change-Id: I11b6c27bd3f4e306c412da8f01761b03dc337ce7 --- include/tables.h | 12 ++++++------ src/mdlib/tables.c | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/include/tables.h b/include/tables.h index defdd3f4a5..5658125dbb 100644 --- a/include/tables.h +++ b/include/tables.h @@ -48,12 +48,12 @@ extern "C" { #endif GMX_LIBMD_EXPORT -void table_spline3_fill_ewald_lr(real *table_F, - real *table_V, - real *table_FDV0, - int ntab, - real dx, - real beta); +void table_spline3_fill_ewald_lr(real *table_F, + real *table_V, + real *table_FDV0, + int ntab, + double dx, + real beta); /* Fill tables of ntab points with spacing dr with the ewald long-range * (mesh) force. * There are three separate tables with format FDV0, F, and V. diff --git a/src/mdlib/tables.c b/src/mdlib/tables.c index fc6df57e8d..a994d22731 100644 --- a/src/mdlib/tables.c +++ b/src/mdlib/tables.c @@ -143,12 +143,12 @@ static double v_ewald_lr(double beta, double r) } } -void table_spline3_fill_ewald_lr(real *table_f, - real *table_v, - real *table_fdv0, - int ntab, - real dx, - real beta) +void table_spline3_fill_ewald_lr(real *table_f, + real *table_v, + real *table_fdv0, + int ntab, + double dx, + real beta) { real tab_max; int i, i_inrange; -- 2.22.0