Adjust ewald_rtol when passing it to OpenMM.
authorRossen Apostolov <rossen@cbr.su.se>
Fri, 23 Jul 2010 14:10:04 +0000 (16:10 +0200)
committerRossen Apostolov <rossen@cbr.su.se>
Fri, 23 Jul 2010 14:10:04 +0000 (16:10 +0200)
src/kernel/openmm_wrapper.cpp

index b3e22180a155d32fcf9fd5b61e824a6e42cb6b69..93c697d993c62a9be176cd24c5bdae1ec316d4a8 100644 (file)
@@ -986,20 +986,19 @@ void* openmm_init(FILE *fplog, const char *platformOptStr,
 
         /* Fix for PME and Ewald error tolerance 
          *
-        *  OpenMM uses approximate formulas to calculate the Ewald parameter:
-        *  alpha = (1.0/cutoff)*sqrt(-log(2.0*tolerlance));
-        *  and the grid spacing for PME:
-        *  gridX = ceil(2*alpha*box[0][0]/3*(pow(tol, 0.2)));
-        *  gridY = ceil(2*alpha*box[1][1]/3*(pow(tol, 0.2)));
-        *  gridZ = ceil(2*alpha*box[2][2]/3*(pow(tol, 0.2)));
-         *
-        *  It overestimates the precision and setting it to 
-        *  (100 x ewald_rtol) seems to give a reasonable match to the GROMACS settings
-         *  
-         *  If the default ewald_rtol=1e-5 is used we silently adjust the value,
-         * otherwise a warning is issued about the action taken. 
-        */
-        double corr_ewald_rtol = 100.0 * ir->ewald_rtol;
+                *  OpenMM uses approximate formulas to calculate the Ewald parameter:
+                *  alpha = (1.0/cutoff)*sqrt(-log(2.0*tolerlance));
+                *  and the grid spacing for PME:
+                *  gridX = ceil(2*alpha*box[0][0]/3*(pow(tol, 0.2)))
+                *  gridY = ceil(2*alpha*box[1][1]/3*(pow(tol, 0.2)));
+                *  gridZ = ceil(2*alpha*box[2][2]/3*(pow(tol, 0.2)));
+                *
+                *  
+                *  If the default ewald_rtol=1e-5 is used we silently adjust the value to the 
+                *  OpenMM default of 5e-4 otherwise a warning is issued about the action taken. 
+                *
+               */
+        double corr_ewald_rtol = 50.0 * ir->ewald_rtol;
         if ((ir->ePBC == epbcXYZ) && 
             (ir->coulombtype == eelEWALD || ir->coulombtype == eelPME))
         {