Removed unused variable in force table generation
authorMark Abraham <mark.j.abraham@gmail.com>
Sun, 12 Apr 2020 12:58:59 +0000 (14:58 +0200)
committerMark Abraham <mark.j.abraham@gmail.com>
Sun, 12 Apr 2020 13:00:04 +0000 (15:00 +0200)
Also reduced the scope of a related variable.

src/gromacs/tables/forcetable.cpp

index abddc26cc1789d1479492ca0297453af0a29c530..5b75deb2e488057c3db33d6c66da0c798d9a5d2d 100644 (file)
@@ -781,7 +781,7 @@ static void fill_table(t_tabledata* td, int tp, const interaction_const_t* ic, g
     int    i;
     double reppow, p;
     double r1, rc, r12, r13;
-    double r, r2, r6, rc2, rc6, rc12;
+    double r, r2, r6, rc2;
     double expr, Vtab, Ftab;
     /* Parameters for David's function */
     double A = 0, B = 0, C = 0, A_3 = 0, B_4 = 0;
@@ -867,8 +867,9 @@ static void fill_table(t_tabledata* td, int tp, const interaction_const_t* ic, g
 
     if (bPotentialShift)
     {
-        rc2 = rc * rc;
-        rc6 = 1.0 / (rc2 * rc2 * rc2);
+        rc2        = rc * rc;
+        double rc6 = 1.0 / (rc2 * rc2 * rc2);
+        double rc12;
         if (gmx_within_tol(reppow, 12.0, 10 * GMX_DOUBLE_EPS))
         {
             rc12 = rc6 * rc6;
@@ -964,9 +965,6 @@ static void fill_table(t_tabledata* td, int tp, const interaction_const_t* ic, g
             swi1 = 0.0;
         }
 
-        rc6 = rc * rc * rc;
-        rc6 = 1.0 / (rc6 * rc6);
-
         switch (tp)
         {
             case etabLJ6: