Merge release-4-6 into master
[alexxy/gromacs.git] / src / gromacs / gmxpreprocess / readir.c
index 2bcc288e5d9708a9bddbddb4e700ff906d409b34..4ec13d321e3ad13183aeef39fe667d25ef7108de 100644 (file)
@@ -578,14 +578,6 @@ void check_ir(const char *mdparin, t_inputrec *ir, t_gromppopts *opts,
                 (int)fep->sc_r_power);
         CHECK(fep->sc_alpha != 0 && fep->sc_r_power != 6.0 && fep->sc_r_power != 48.0);
 
-        /* check validity of options */
-        if (fep->n_lambda > 0 && ir->rlist < max(ir->rvdw, ir->rcoulomb))
-        {
-            sprintf(warn_buf,
-                    "For foreign lambda free energy differences it is assumed that the soft-core interactions have no effect beyond the neighborlist cut-off");
-            warning(wi, warn_buf);
-        }
-
         sprintf(err_buf, "Can't use postive delta-lambda (%g) if initial state/lambda does not start at zero", fep->delta_lambda);
         CHECK(fep->delta_lambda > 0 && ((fep->init_fep_state > 0) ||  (fep->init_lambda > 0)));
 
@@ -666,8 +658,16 @@ void check_ir(const char *mdparin, t_inputrec *ir, t_gromppopts *opts,
 
         if ((fep->bScCoul) && (EEL_PME(ir->coulombtype)))
         {
-            sprintf(warn_buf, "With coulomb soft core, the reciprocal space calculation will not necessarily cancel.  It may be necessary to decrease the reciprocal space energy, and increase the cutoff radius to get sufficiently close matches to energies with free energy turned off.");
-            warning(wi, warn_buf);
+            real sigma, lambda, r_sc;
+
+            sigma  = 0.34;
+            /* Maximum estimate for A and B charges equal with lambda power 1 */
+            lambda = 0.5;
+            r_sc   = pow(lambda*fep->sc_alpha*pow(sigma/ir->rcoulomb, fep->sc_r_power) + 1.0, 1.0/fep->sc_r_power);
+            sprintf(warn_buf, "With PME there is a minor soft core effect present at the cut-off, proportional to (LJsigma/rcoulomb)^%g. This could have a minor effect on energy conservation, but usually other effects dominate. With a common sigma value of %g nm the fraction of the particle-particle potential at the cut-off at lambda=%g is around %.1e, while ewald-rtol is %.1e.",
+                    fep->sc_r_power,
+                    sigma, lambda, r_sc - 1.0, ir->ewald_rtol);
+            warning_note(wi, warn_buf);
         }
 
         /*  Free Energy Checks -- In an ideal world, slow growth and FEP would