Merge branch release-5-1 into release-2016
authorMark Abraham <mark.j.abraham@gmail.com>
Sun, 5 Feb 2017 20:03:24 +0000 (21:03 +0100)
committerMark Abraham <mark.j.abraham@gmail.com>
Sun, 5 Feb 2017 20:03:58 +0000 (21:03 +0100)
Resolved conflict in gmx_order in favour of newly
corrected code from release-5-1 branch.

Change-Id: I7ed58873c0629bd33e18dd887d63b6ee8af7e32b

docs/user-guide/mdp-options.rst
src/gromacs/gmxana/gmx_order.cpp

index d0c44d28cd1104c4066318d519a9c8d662b0a941..54d7e19b64de663e8d8fab277b96638704f82046 100644 (file)
@@ -1108,19 +1108,23 @@ Pressure coupling
 
 .. mdp:: pcoupltype
 
+   Specifies the kind of isotropy of the pressure coupling used. Each
+   kind takes one or more values for :mdp:`compressibility` and
+   :mdp:`ref-p`. Only a single value is permitted for :mdp:`tau-p`.
+
    .. mdp-value:: isotropic
 
       Isotropic pressure coupling with time constant
-      :mdp:`tau-p`. The compressibility and reference pressure are
-      set with :mdp:`compressibility` and :mdp:`ref-p`, one value is
-      needed.
+      :mdp:`tau-p`. One value each for :mdp:`compressibility` and
+      :mdp:`ref-p` is required.
 
    .. mdp-value:: semiisotropic
 
       Pressure coupling which is isotropic in the ``x`` and ``y``
       direction, but different in the ``z`` direction. This can be
-      useful for membrane simulations. 2 values are needed for ``x/y``
-      and ``z`` directions respectively.
+      useful for membrane simulations. Two values each for
+      :mdp:`compressibility` and :mdp:`ref-p` are required, for
+      ``x/y`` and ``z`` directions respectively.
 
    .. mdp-value:: anisotropic
 
@@ -1156,18 +1160,21 @@ Pressure coupling
 .. mdp:: tau-p
 
    (1) \[ps\]
-   time constant for coupling
+   The time constant for pressure coupling (one value for all
+   directions).
 
 .. mdp:: compressibility
 
    \[bar^-1\]
-   compressibility (NOTE: this is now really in bar-1) For water at 1
-   atm and 300 K the compressibility is 4.5e-5 bar^-1.
+   The compressibility (NOTE: this is now really in bar^-1) For water at 1
+   atm and 300 K the compressibility is 4.5e-5 bar^-1. The number of
+   required values is implied by :mdp:`pcoupltype`.
 
 .. mdp:: ref-p
 
    \[bar\]
-   reference pressure for coupling
+   The reference pressure for coupling. The number of required values
+   is implied by :mdp:`pcoupltype`.
 
 .. mdp:: refcoord-scaling
 
index d48e5d4f907440308c864e991419cb9bc9678126..1f1bad24f57028e9b7fcabefccfd91f75b857dba 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, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, 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.
@@ -637,16 +637,13 @@ void calc_order(const char *fn, int *index, int *a, rvec **order,
                     z1    = x1[a[index[i-1]+j]][axis];
                     z2    = x1[a[index[i+1]+j]][axis];
                     z_ave = 0.5 * (z1 + z2);
-                    if (z_ave < 0)
+                    slice = (int)((nslices*z_ave)/box[axis][axis]);
+                    while (slice < 0)
                     {
-                        z_ave += box[axis][axis];
-                    }
-                    if (z_ave > box[axis][axis])
-                    {
-                        z_ave -= box[axis][axis];
+                        slice += nslices;
                     }
+                    slice =  slice % nslices;
 
-                    slice  = static_cast<int>((0.5 + (z_ave / (*slWidth))) - 1);
                     slCount[slice]++;     /* determine slice, increase count */
 
                     slFrameorder[slice] += 0.5 * (3 * cossum[axis] - 1);