Merge branch 'release-4-6'
[alexxy/gromacs.git] / src / gromacs / gmxpreprocess / readir.c
index 323309366d8fa49f5ff71197bd9e896804d59313..641e7dc5a160fc8eff8bb481936afe591ab1719a 100644 (file)
@@ -1076,6 +1076,17 @@ void check_ir(const char *mdparin, t_inputrec *ir, t_gromppopts *opts,
         warning_note(wi, warn_buf);
     }
 
+    if (ir->coulombtype == eelPMESWITCH)
+    {
+        if (ir->rcoulomb_switch/ir->rcoulomb < 0.9499)
+        {
+            sprintf(warn_buf, "The switching range for %s should be 5%% or less, energy conservation will be good anyhow, since ewald_rtol = %g",
+                    eel_names[ir->coulombtype],
+                    ir->ewald_rtol);
+            warning(wi, warn_buf);
+        }
+    }
+
     if (EEL_FULL(ir->coulombtype))
     {
         if (ir->coulombtype == eelPMESWITCH || ir->coulombtype == eelPMEUSER ||
@@ -1142,6 +1153,16 @@ void check_ir(const char *mdparin, t_inputrec *ir, t_gromppopts *opts,
     }
     if (ir->cutoff_scheme == ecutsGROUP)
     {
+        if (((ir->coulomb_modifier != eintmodNONE && ir->rcoulomb == ir->rlist) ||
+             (ir->vdw_modifier != eintmodNONE && ir->rvdw == ir->rlist)) &&
+            ir->nstlist != 1)
+        {
+            warning_note(wi, "With exact cut-offs, rlist should be "
+                         "larger than rcoulomb and rvdw, so that there "
+                         "is a buffer region for particle motion "
+                         "between neighborsearch steps");
+        }
+
         if (EEL_IS_ZERO_AT_CUTOFF(ir->coulombtype)
             && (ir->rlistlong <= ir->rcoulomb))
         {
@@ -3821,7 +3842,10 @@ void check_chargegroup_radii(const gmx_mtop_t *mtop, const t_inputrec *ir,
         if (rvdw1  + rvdw2  > ir->rlist ||
             rcoul1 + rcoul2 > ir->rlist)
         {
-            sprintf(warn_buf, "The sum of the two largest charge group radii (%f) is larger than rlist (%f)\n", max(rvdw1+rvdw2, rcoul1+rcoul2), ir->rlist);
+            sprintf(warn_buf,
+                    "The sum of the two largest charge group radii (%f) "
+                    "is larger than rlist (%f)\n",
+                    max(rvdw1+rvdw2, rcoul1+rcoul2), ir->rlist);
             warning(wi, warn_buf);
         }
         else
@@ -3830,13 +3854,19 @@ void check_chargegroup_radii(const gmx_mtop_t *mtop, const t_inputrec *ir,
              * since user defined interactions might purposely
              * not be zero at the cut-off.
              */
-            if (EVDW_IS_ZERO_AT_CUTOFF(ir->vdwtype) &&
+            if ((EVDW_IS_ZERO_AT_CUTOFF(ir->vdwtype) ||
+                 ir->vdw_modifier != eintmodNONE) &&
                 rvdw1 + rvdw2 > ir->rlistlong - ir->rvdw)
             {
-                sprintf(warn_buf, "The sum of the two largest charge group radii (%f) is larger than %s (%f) - rvdw (%f)\n",
+                sprintf(warn_buf, "The sum of the two largest charge group "
+                        "radii (%f) is larger than %s (%f) - rvdw (%f).\n"
+                        "With exact cut-offs, better performance can be "
+                        "obtained with cutoff-scheme = %s, because it "
+                        "does not use charge groups at all.",
                         rvdw1+rvdw2,
                         ir->rlistlong > ir->rlist ? "rlistlong" : "rlist",
-                        ir->rlistlong, ir->rvdw);
+                        ir->rlistlong, ir->rvdw,
+                        ecutscheme_names[ecutsVERLET]);
                 if (ir_NVE(ir))
                 {
                     warning(wi, warn_buf);
@@ -3846,13 +3876,16 @@ void check_chargegroup_radii(const gmx_mtop_t *mtop, const t_inputrec *ir,
                     warning_note(wi, warn_buf);
                 }
             }
-            if (EEL_IS_ZERO_AT_CUTOFF(ir->coulombtype) &&
+            if ((EEL_IS_ZERO_AT_CUTOFF(ir->coulombtype) ||
+                 ir->coulomb_modifier != eintmodNONE) &&
                 rcoul1 + rcoul2 > ir->rlistlong - ir->rcoulomb)
             {
-                sprintf(warn_buf, "The sum of the two largest charge group radii (%f) is larger than %s (%f) - rcoulomb (%f)\n",
+                sprintf(warn_buf, "The sum of the two largest charge group radii (%f) is larger than %s (%f) - rcoulomb (%f).\n"
+                        "With exact cut-offs, better performance can be obtained with cutoff-scheme = %s, because it does not use charge groups at all.",
                         rcoul1+rcoul2,
                         ir->rlistlong > ir->rlist ? "rlistlong" : "rlist",
-                        ir->rlistlong, ir->rcoulomb);
+                        ir->rlistlong, ir->rcoulomb,
+                        ecutscheme_names[ecutsVERLET]);
                 if (ir_NVE(ir))
                 {
                     warning(wi, warn_buf);