Allow rcoulomb=rlistlong for PME with nstcalclr=1
authorErik Lindahl <erik@kth.se>
Thu, 8 Nov 2012 19:08:11 +0000 (20:08 +0100)
committerErik Lindahl <erik@kth.se>
Thu, 8 Nov 2012 19:08:11 +0000 (20:08 +0100)
This patch allows mdp files to set a VdW cutoff shorter than the
coulomb cutoff, even when not using potential modifiers for PME.
While this might come in handy in some cases, it is also needed for
the new kernel tests.

Change-Id: I4bef433a47a685f4f839b12b473047057608354d

src/kernel/readir.c

index edaf0d31605cd030b9566db1f3348be099f3f932..d3efd3d3fd0455b2d75f0217fb2b2b699bd7fe14 100644 (file)
@@ -988,10 +988,17 @@ void check_ir(const char *mdparin,t_inputrec *ir, t_gromppopts *opts,
           if (ir->coulombtype == eelPME || ir->coulombtype == eelP3M_AD)
           {
               sprintf(err_buf,
-                      "With coulombtype = %s (without modifier), rcoulomb must be equal to rlist.\n"
-                      "If you want optimal energy conservation, consider using a potential modifier.",
-                      eel_names[ir->coulombtype]);
-              CHECK(ir->rcoulomb != ir->rlist);
+                      "With coulombtype = %s (without modifier), rcoulomb must be equal to rlist,\n"
+                      "or rlistlong if nstcalclr=1. For optimal energy conservation,consider using\n"
+                      "a potential modifier.",eel_names[ir->coulombtype]);
+              if(ir->nstcalclr==1)
+              {
+                  CHECK(ir->rcoulomb != ir->rlist && ir->rcoulomb != ir->rlistlong);
+              }
+              else
+              {
+                  CHECK(ir->rcoulomb != ir->rlist);
+              }
           }
       }
   }