Added warning for unnecessary soft-core
authorBerk Hess <hess@kth.se>
Thu, 13 Nov 2014 11:30:33 +0000 (12:30 +0100)
committerGerrit Code Review <gerrit@gerrit.gromacs.org>
Mon, 1 Dec 2014 09:10:51 +0000 (10:10 +0100)
The sc-coul mdp option is, presently, only active with lambda states.
grompp now issues a warning when using soft-core without Van der Waals
decoupling without lambda states.
Also fixed an incorrect twin-range grompp check with PME.

Refs #1421.

Change-Id: I0605fe0f735d69f96f478612a00434eccef6232f

src/gromacs/gmxpreprocess/readir.c

index 034b481091831b0e41da71af2dc868d321dc8fe8..3319882e7fd9a83f913fe853fd79047e49687f8e 100644 (file)
@@ -456,7 +456,7 @@ void check_ir(const char *mdparin, t_inputrec *ir, t_gromppopts *opts,
         warning_error(wi, "nstcalclr must be a positive number (divisor of nstcalclr), or -1 to follow nstlist.");
     }
 
-    if (EEL_PME(ir->coulombtype) && ir->rcoulomb > ir->rvdw && ir->nstcalclr > 1)
+    if (EEL_PME(ir->coulombtype) && ir->rcoulomb > ir->rlist && ir->nstcalclr > 1)
     {
         warning_error(wi, "When used with PME, the long-range component of twin-range interactions must be updated every step (nstcalclr)");
     }
@@ -2422,6 +2422,22 @@ void get_ir(const char *mdparin, const char *mdparout,
         {
             do_simtemp_params(ir);
         }
+
+        /* Because sc-coul (=FALSE by default) only acts on the lambda state
+         * setup and not on the old way of specifying the free-energy setup,
+         * we should check for using soft-core when not needed, since that
+         * can complicate the sampling significantly.
+         * Note that we only check for the automated coupling setup.
+         * If the (advanced) user does FEP through manual topology changes,
+         * this check will not be triggered.
+         */
+        if (ir->efep != efepNO && ir->fepvals->n_lambda == 0 &&
+            ir->fepvals->sc_alpha != 0 &&
+            ((opts->couple_lam0 == ecouplamVDW  && opts->couple_lam0 == ecouplamVDWQ) ||
+             (opts->couple_lam1 == ecouplamVDWQ && opts->couple_lam1 == ecouplamVDW)))
+        {
+            warning(wi, "You are using soft-core interactions while the Van der Waals interactions are not decoupled (note that the sc-coul option is only active when using lambda states). Although this will not lead to errors, you will need much more sampling than without soft-core interactions. Consider using sc-alpha=0.");
+        }
     }
     else
     {