Merge branch release-4-6
authorMark Abraham <mark.j.abraham@gmail.com>
Fri, 14 Mar 2014 18:08:48 +0000 (19:08 +0100)
committerMark Abraham <mark.j.abraham@gmail.com>
Mon, 17 Mar 2014 15:45:30 +0000 (16:45 +0100)
Conflicts:
src/gromacs/pulling/pull_rotation.c
Adopted the bugfixes from release-4-6

Uncrustified incoming code

Change-Id: I7d90bb49ef83750b9607f677e97a94f2b5793eeb

src/gromacs/gmxana/gmx_tune_pme.c
src/gromacs/pulling/pull_rotation.c

index 25f4c30065c6f3fa6b06874edbbbeb86ea53fd8c..eeed72959175821a327af34cd2d7a41528194d9c 100644 (file)
@@ -994,7 +994,7 @@ static void make_benchmark_tprs(
             ir->nkx = ir->nky = ir->nkz = 0;
             calc_grid(NULL, state.box, fourierspacing*fac, &ir->nkx, &ir->nky, &ir->nkz);
 
-            /* Adjust other radii since various conditions neet to be fulfilled */
+            /* Adjust other radii since various conditions need to be fulfilled */
             if (eelPME == ir->coulombtype)
             {
                 /* plain PME, rcoulomb must be equal to rlist */
@@ -1008,8 +1008,16 @@ static void make_benchmark_tprs(
 
             if (bScaleRvdw && evdwCUT == ir->vdwtype)
             {
-                /* For vdw cutoff, rvdw >= rlist */
-                ir->rvdw = max(info->rvdw[0], ir->rlist);
+                if (ecutsVERLET == ir->cutoff_scheme)
+                {
+                    /* With Verlet, the van der Waals radius must always equal the Coulomb radius */
+                    ir->rvdw = ir->rcoulomb;
+                }
+                else
+                {
+                    /* For vdw cutoff, rvdw >= rlist */
+                    ir->rvdw = max(info->rvdw[0], ir->rlist);
+                }
             }
 
             ir->rlistlong = max_cutoff(ir->rlist, max_cutoff(ir->rvdw, ir->rcoulomb));
index 0590801eb51b7354dee4e31221e175d22cdbdb12..6f2d45accb1065b66c80d35367c29c0cc9685182 100644 (file)
@@ -65,6 +65,7 @@
 #include "gromacs/utility/qsort_threadsafe.h"
 #include "gromacs/pulling/pull_rotation.h"
 #include "gromacs/mdlib/groupcoord.h"
+#include "gromacs/math/utilities.h"
 
 static char *RotStr = {"Enforced rotation:"};
 
@@ -1972,7 +1973,7 @@ static real do_flex2_lowlevel(
              * However, since the atom is located directly on the pivot, this
              * slab's contribution to the force on that atom will be zero
              * anyway. Therefore, we directly move on to the next slab.       */
-            if (0 == norm(tmpvec2) )
+            if (gmx_numzero(norm(tmpvec2))) /* 0 == norm(xj - xcn) */
             {
                 continue;
             }
@@ -2200,22 +2201,22 @@ static real do_flex_lowlevel(
 
             rvec_sub(yj0, ycn, yj0_ycn); /* yj0_ycn = yj0 - ycn */
 
-            /* Rotate: */
-            mvmul(erg->rotmat, yj0_ycn, tmpvec2); /* tmpvec2= Omega.(yj0-ycn) */
-
-            /* Subtract the slab center from xj */
-            rvec_sub(xj, xcn, xj_xcn);           /* xj_xcn = xj - xcn         */
-
-            /* In rare cases, when an atom position coincides with a slab center
-             * (xj_xcn == 0) we cannot compute the vector product for qjn.
+            /* In rare cases, when an atom position coincides with a reference slab
+             * center (yj0_ycn == 0) we cannot compute the normal vector qjn.
              * However, since the atom is located directly on the pivot, this
              * slab's contribution to the force on that atom will be zero
              * anyway. Therefore, we directly move on to the next slab.       */
-            if (0 == norm(xj_xcn) )
+            if (gmx_numzero(norm(yj0_ycn))) /* 0 == norm(yj0 - ycn) */
             {
                 continue;
             }
 
+            /* Rotate: */
+            mvmul(erg->rotmat, yj0_ycn, tmpvec2); /* tmpvec2= Omega.(yj0-ycn) */
+
+            /* Subtract the slab center from xj */
+            rvec_sub(xj, xcn, xj_xcn);           /* xj_xcn = xj - xcn         */
+
             /* Calculate qjn */
             cprod(rotg->vec, tmpvec2, tmpvec); /* tmpvec= v x Omega.(yj0-ycn) */