corrected grompp constraint/DOF warning with vsites
authorBerk Hess <hess@kth.se>
Tue, 20 Aug 2013 13:53:12 +0000 (15:53 +0200)
committerGerrit Code Review <gerrit@gerrit.gromacs.org>
Fri, 13 Sep 2013 19:30:54 +0000 (21:30 +0200)
grompp now counts constraints after removing the ones with vsites.
Fixes #1322

Change-Id: I1f2b129fa5f4c5f56fea384f2749af833c92eabc

src/kernel/grompp.c

index 8f9ad9bdfea0871d6adf662d80d972a41d6139d1..70c2041b7b0f77a8cf2e7e253ecd08344da81790 100644 (file)
@@ -1530,6 +1530,23 @@ int cmain (int argc, char *argv[])
         pr_symtab(debug, 0, "After new_status", &sys->symtab);
     }
 
+    nvsite = 0;
+    /* set parameters for virtual site construction (not for vsiten) */
+    for (mt = 0; mt < sys->nmoltype; mt++)
+    {
+        nvsite +=
+            set_vsites(bVerbose, &sys->moltype[mt].atoms, atype, mi[mt].plist);
+    }
+    /* now throw away all obsolete bonds, angles and dihedrals: */
+    /* note: constraints are ALWAYS removed */
+    if (nvsite)
+    {
+        for (mt = 0; mt < sys->nmoltype; mt++)
+        {
+            clean_vsite_bondeds(mi[mt].plist, sys->moltype[mt].atoms.nr, bRmVSBds);
+        }
+    }
+
     if (ir->cutoff_scheme == ecutsVERLET)
     {
         fprintf(stderr, "Removing all charge groups because cutoff-scheme=%s\n",
@@ -1629,23 +1646,6 @@ int cmain (int argc, char *argv[])
                    wi);
     }
 
-    nvsite = 0;
-    /* set parameters for virtual site construction (not for vsiten) */
-    for (mt = 0; mt < sys->nmoltype; mt++)
-    {
-        nvsite +=
-            set_vsites(bVerbose, &sys->moltype[mt].atoms, atype, mi[mt].plist);
-    }
-    /* now throw away all obsolete bonds, angles and dihedrals: */
-    /* note: constraints are ALWAYS removed */
-    if (nvsite)
-    {
-        for (mt = 0; mt < sys->nmoltype; mt++)
-        {
-            clean_vsite_bondeds(mi[mt].plist, sys->moltype[mt].atoms.nr, bRmVSBds);
-        }
-    }
-
     /* If we are using CMAP, setup the pre-interpolation grid */
     if (plist->ncmap > 0)
     {