Merge branch 'origin/release-5-1'
[alexxy/gromacs.git] / src / gromacs / mdlib / coupling.cpp
index d5244e7134e431ec07ff984a7664fd6abc6eb087..3b61888a4baa4ac9f993db22040950dd7e63140c 100644 (file)
 
 #include <algorithm>
 
-#include "gromacs/legacyheaders/gmx_omp_nthreads.h"
-#include "gromacs/legacyheaders/macros.h"
-#include "gromacs/legacyheaders/mdrun.h"
-#include "gromacs/legacyheaders/names.h"
-#include "gromacs/legacyheaders/nrnb.h"
-#include "gromacs/legacyheaders/txtdump.h"
-#include "gromacs/legacyheaders/typedefs.h"
-#include "gromacs/legacyheaders/update.h"
-#include "gromacs/legacyheaders/types/commrec.h"
+#include "gromacs/domdec/domdec_struct.h"
+#include "gromacs/fileio/txtdump.h"
+#include "gromacs/gmxlib/gmx_omp_nthreads.h"
+#include "gromacs/gmxlib/nrnb.h"
 #include "gromacs/math/units.h"
 #include "gromacs/math/vec.h"
+#include "gromacs/mdlib/mdrun.h"
+#include "gromacs/mdlib/sim_util.h"
+#include "gromacs/mdlib/update.h"
+#include "gromacs/mdtypes/commrec.h"
+#include "gromacs/mdtypes/energy.h"
+#include "gromacs/mdtypes/group.h"
+#include "gromacs/mdtypes/inputrec.h"
+#include "gromacs/mdtypes/md_enums.h"
+#include "gromacs/pbcutil/boxutilities.h"
+#include "gromacs/pbcutil/pbc.h"
 #include "gromacs/random/random.h"
+#include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/smalloc.h"
 
@@ -659,6 +665,7 @@ void berendsen_pscale(t_inputrec *ir, matrix mu,
 #pragma omp parallel for num_threads(nthreads) schedule(static)
     for (n = start; n < start+nr_atoms; n++)
     {
+        // Trivial OpenMP region that does not throw
         int g;
 
         if (cFREEZE == NULL)
@@ -1097,7 +1104,7 @@ int **init_npt_vars(t_inputrec *ir, t_state *state, t_extmass *MassQ, gmx_bool b
 
     if (ir->eI == eiVV)
     {
-        if (IR_NPT_TROTTER(ir))
+        if (inputrecNptTrotter(ir))
         {
             /* This is the complicated version - there are 4 possible calls, depending on ordering.
                We start with the initial one. */
@@ -1119,14 +1126,14 @@ int **init_npt_vars(t_inputrec *ir, t_state *state, t_extmass *MassQ, gmx_bool b
             /* trotter_seq[4] is etrtNHC for second 1/2 step velocities - leave zero */
 
         }
-        else if (IR_NVT_TROTTER(ir))
+        else if (inputrecNvtTrotter(ir))
         {
             /* This is the easy version - there are only two calls, both the same.
                Otherwise, even easier -- no calls  */
             trotter_seq[2][0] = etrtNHC;
             trotter_seq[3][0] = etrtNHC;
         }
-        else if (IR_NPH_TROTTER(ir))
+        else if (inputrecNphTrotter(ir))
         {
             /* This is the complicated version - there are 4 possible calls, depending on ordering.
                We start with the initial one. */
@@ -1148,7 +1155,7 @@ int **init_npt_vars(t_inputrec *ir, t_state *state, t_extmass *MassQ, gmx_bool b
     }
     else if (ir->eI == eiVVAK)
     {
-        if (IR_NPT_TROTTER(ir))
+        if (inputrecNptTrotter(ir))
         {
             /* This is the complicated version - there are 4 possible calls, depending on ordering.
                We start with the initial one. */
@@ -1169,14 +1176,14 @@ int **init_npt_vars(t_inputrec *ir, t_state *state, t_extmass *MassQ, gmx_bool b
             /* The second half trotter update */
             trotter_seq[4][0] = etrtNHC;
         }
-        else if (IR_NVT_TROTTER(ir))
+        else if (inputrecNvtTrotter(ir))
         {
             /* This is the easy version - there is only one call, both the same.
                Otherwise, even easier -- no calls  */
             trotter_seq[1][0] = etrtNHC;
             trotter_seq[4][0] = etrtNHC;
         }
-        else if (IR_NPH_TROTTER(ir))
+        else if (inputrecNphTrotter(ir))
         {
             /* This is the complicated version - there are 4 possible calls, depending on ordering.
                We start with the initial one. */
@@ -1286,7 +1293,7 @@ real NPT_energy(t_inputrec *ir, t_state *state, t_extmass *MassQ)
         }
     }
 
-    if (IR_NPT_TROTTER(ir) || IR_NPH_TROTTER(ir))
+    if (inputrecNptTrotter(ir) || inputrecNphTrotter(ir))
     {
         /* add the energy from the barostat thermostat chain */
         for (i = 0; i < state->nnhpres; i++)
@@ -1329,7 +1336,7 @@ real NPT_energy(t_inputrec *ir, t_state *state, t_extmass *MassQ)
 
             if (nd > 0.0)
             {
-                if (IR_NVT_TROTTER(ir))
+                if (inputrecNvtTrotter(ir))
                 {
                     /* contribution from the thermal momenta of the NH chain */
                     for (j = 0; j < nh; j++)