Only extend Ewald table when necessary
authorBerk Hess <hess@kth.se>
Tue, 15 Sep 2020 09:40:23 +0000 (11:40 +0200)
committerPaul Bauer <paul.bauer.q@gmail.com>
Tue, 15 Sep 2020 12:42:04 +0000 (12:42 +0000)
The Ewald correction table for non-bonded interactions was always
extended by change 24595dbb. No this is limited to free-energy
runs only.

src/gromacs/mdlib/forcerec.cpp

index e2ce454bd2d5d815e8a9d98d32b1691a659fcc2d..1bd965839295e42b69ee6a5a5c23644775149b53 100644 (file)
@@ -732,8 +732,10 @@ static void init_ewald_f_table(const interaction_const_t& ic,
      */
     const real tableScale = ewald_spline3_table_scale(ic, useCoulombTable, useVdwTable);
 
+    const bool havePerturbedNonbondeds = (ic.softCoreParameters != nullptr);
+
     real tableLen = ic.rcoulomb;
-    if (useCoulombTable && tableExtensionLength > 0.0)
+    if (useCoulombTable && havePerturbedNonbondeds && tableExtensionLength > 0.0)
     {
         /* TODO: Ideally this should also check if couple-intramol == no, but that isn't
          * stored in ir. Grompp puts that info into an opts structure that doesn't make it into the tpr.