Merge branch 'release-2016'
[alexxy/gromacs.git] / src / gromacs / tables / forcetable.cpp
index 04eae447f76929965d45e3896b08f082487577f1..6ef0b7d1f72315c2c70ca6ba7451045add273b87 100644 (file)
@@ -211,7 +211,7 @@ void table_spline3_fill_ewald_lr(real                                 *table_f,
             vi = v_inrange - dc*(i - i_inrange)*dx;
         }
 
-        if (table_v != NULL)
+        if (table_v != nullptr)
         {
             table_v[i] = vi;
         }
@@ -281,7 +281,7 @@ void table_spline3_fill_ewald_lr(real                                 *table_f,
     /* Currently the last value only contains half the force: double it */
     table_f[0] *= 2;
 
-    if (table_v != NULL && table_fdv0 != NULL)
+    if (table_v != nullptr && table_fdv0 != nullptr)
     {
         /* Copy to FDV0 table too. Allocation occurs in forcerec.c,
          * init_ewald_f_table().
@@ -382,37 +382,6 @@ real ewald_spline3_table_scale(const interaction_const_t *ic)
     return sc;
 }
 
-/* Calculate the potential and force for an r value
- * in exactly the same way it is done in the inner loop.
- * VFtab is a pointer to the table data, offset is
- * the point where we should begin and stride is
- * 4 if we have a buckingham table, 3 otherwise.
- * If you want to evaluate table no N, set offset to 4*N.
- *
- * We use normal precision here, since that is what we
- * will use in the inner loops.
- */
-static void evaluate_table(real VFtab[], int offset, int stride,
-                           real tabscale, real r, real *y, real *yp)
-{
-    int  n;
-    real rt, eps, eps2;
-    real Y, F, Geps, Heps2, Fp;
-
-    rt       =  r*tabscale;
-    n        =  (int)rt;
-    eps      =  rt - n;
-    eps2     =  eps*eps;
-    n        =  offset+stride*n;
-    Y        =  VFtab[n];
-    F        =  VFtab[n+1];
-    Geps     =  eps*VFtab[n+2];
-    Heps2    =  eps2*VFtab[n+3];
-    Fp       =  F+Geps+Heps2;
-    *y       =  Y+eps*Fp;
-    *yp      =  (Fp+Geps+2.0*Heps2)*tabscale;
-}
-
 static void copy2table(int n, int offset, int stride,
                        double x[], double Vtab[], double Ftab[], real scalefactor,
                        real dest[])
@@ -609,7 +578,7 @@ static void read_tables(FILE *fp, const char *fn,
 {
     char    *libfn;
     char     buf[STRLEN];
-    double **yy = NULL, start, end, dx0, dx1, ssd, vm, vp, f, numf;
+    double **yy = nullptr, start, end, dx0, dx1, ssd, vm, vp, f, numf;
     int      k, i, nx, nx0 = 0, ny, nny, ns;
     gmx_bool bAllZero, bZeroV, bZeroF;
     double   tabscale;
@@ -1573,9 +1542,9 @@ t_forcetable *makeDispersionCorrectionTable(FILE *fp,
                                             t_forcerec *fr, real rtab,
                                             const char *tabfn)
 {
-    t_forcetable *dispersionCorrectionTable = NULL;
+    t_forcetable *dispersionCorrectionTable = nullptr;
 
-    if (tabfn == NULL)
+    if (tabfn == nullptr)
     {
         if (debug)
         {