Don't write reference pull group 0 to log
authorErik Lindahl <erik@kth.se>
Mon, 1 Jan 2018 23:28:28 +0000 (00:28 +0100)
committerMark Abraham <mark.j.abraham@gmail.com>
Tue, 2 Jan 2018 11:12:37 +0000 (12:12 +0100)
This is an internal group used for absolute
references, which cannot be set by users, so
printing it just leads to confusion.

Fixes #2143.

Change-Id: I89ee3a0e3a65855735b745f4ed7615ca47bfd36a

src/gromacs/pulling/pull.cpp

index 9a4720204103bf7a21045f4169f2b066e58a2336..b7b1189747c726a46b8f9f9f39b5a375e8c6fb3b 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -2318,15 +2318,18 @@ init_pull(FILE *fplog, const pull_params_t *pull_params, const t_inputrec *ir,
         {
             fprintf(fplog, "Will apply constraint COM pulling\n");
         }
+        // Don't include the reference group 0 in output, so we report ngroup-1
+        GMX_RELEASE_ASSERT(pull->ngroup - 1 > 0, "The reference absolute position pull group should always be present");
         fprintf(fplog, "with %d pull coordinate%s and %d group%s\n",
                 pull->ncoord, pull->ncoord == 1 ? "" : "s",
-                pull->ngroup, pull->ngroup == 1 ? "" : "s");
+                (pull->ngroup - 1), (pull->ngroup - 1) == 1 ? "" : "s");
         if (bAbs)
         {
             fprintf(fplog, "with an absolute reference\n");
         }
         bCos = FALSE;
-        for (g = 0; g < pull->ngroup; g++)
+        // Don't include the reference group 0 in loop
+        for (g = 1; g < pull->ngroup; g++)
         {
             if (pull->group[g].params.nat > 1 &&
                 pull->group[g].params.pbcatom < 0)