Fix Andersen thermostats
authorMark Abraham <mark.j.abraham@gmail.com>
Tue, 3 Mar 2015 12:29:52 +0000 (13:29 +0100)
committerGerrit Code Review <gerrit@gerrit.gromacs.org>
Thu, 5 Mar 2015 11:08:31 +0000 (12:08 +0100)
The logic for which type of Andersen thermostat has which
implementation got inverted while implementing support for Random123.

Fixes #1695

Change-Id: Ibb7663160bab0ffbb41e23e0d1e97a151940f47b

src/gromacs/mdlib/coupling.c

index 0898371728aca74a1a835ed6d9f471378154813f..2025ec9193c33f88830be94125ec749c27689957 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, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015, 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.
@@ -743,12 +743,14 @@ void andersen_tcoupl(t_inputrec *ir, gmx_int64_t step,
         }
         if (randomize[gc])
         {
-            if (ir->etc == etcANDERSEN)
+            if (ir->etc == etcANDERSENMASSIVE)
             {
+                /* Randomize particle always */
                 bRandomize = TRUE;
             }
             else
             {
+                /* Randomize particle probabilistically */
                 double uniform[2];
 
                 gmx_rng_cycle_2uniform(step*2, ng, ir->andersen_seed, RND_SEED_ANDERSEN, uniform);