Merge branch release-2020 into master
[alexxy/gromacs.git] / src / gromacs / mdrun / rerun.cpp
index 956bd1ab1cbdd33e3ca7e8f673e5ebe4586607b9..29c1ae1c6bc383dcfabfb2eeff45f938bc7fd69d 100644 (file)
@@ -59,8 +59,8 @@
 #include "gromacs/domdec/mdsetup.h"
 #include "gromacs/domdec/partition.h"
 #include "gromacs/essentialdynamics/edsam.h"
-#include "gromacs/ewald/pme.h"
 #include "gromacs/ewald/pme_load_balancing.h"
+#include "gromacs/ewald/pme_pp.h"
 #include "gromacs/fileio/trxio.h"
 #include "gromacs/gmxlib/network.h"
 #include "gromacs/gmxlib/nrnb.h"
@@ -171,11 +171,11 @@ static void prepareRerunState(const t_trxframe&  rerunFrame,
             /* Following is necessary because the graph may get out of sync
              * with the coordinates if we only have every N'th coordinate set
              */
-            mk_mshift(nullptr, graph, forceRec.ePBC, globalState->box, globalState->x.rvec_array());
+            mk_mshift(nullptr, graph, forceRec.pbcType, globalState->box, globalState->x.rvec_array());
             shift_self(graph, globalState->box, as_rvec_array(globalState->x.data()));
         }
         construct_vsites(vsite, globalState->x.rvec_array(), timeStep, globalState->v.rvec_array(),
-                         idef.iparams, idef.il, forceRec.ePBC, forceRec.bMolPBC, nullptr,
+                         idef.iparams, idef.il, forceRec.pbcType, forceRec.bMolPBC, nullptr,
                          globalState->box);
         if (graph)
         {
@@ -373,13 +373,13 @@ void gmx::LegacySimulator::do_rerun()
                  | (shouldCheckNumberOfBondedInteractions ? CGLO_CHECK_NUMBER_OF_BONDED_INTERACTIONS : 0));
         bool   bSumEkinhOld = false;
         t_vcm* vcm          = nullptr;
-        compute_globals(gstat, cr, ir, fr, ekind, state->x.rvec_array(), state->v.rvec_array(),
-                        state->box, state->lambda[efptVDW], mdatoms, nrnb, vcm, nullptr, enerd,
-                        force_vir, shake_vir, total_vir, pres, mu_tot, constr, &nullSignaller,
+        compute_globals(gstat, cr, ir, fr, ekind, makeConstArrayRef(state->x),
+                        makeConstArrayRef(state->v), state->box, state->lambda[efptVDW], mdatoms, nrnb,
+                        vcm, nullptr, enerd, force_vir, shake_vir, total_vir, pres, constr, &nullSignaller,
                         state->box, &totalNumberOfBondedInteractions, &bSumEkinhOld, cglo_flags);
     }
     checkNumberOfBondedInteractions(mdlog, cr, totalNumberOfBondedInteractions, top_global, &top,
-                                    state->x.rvec_array(), state->box,
+                                    makeConstArrayRef(state->x), state->box,
                                     &shouldCheckNumberOfBondedInteractions);
 
     if (MASTER(cr))
@@ -427,7 +427,7 @@ void gmx::LegacySimulator::do_rerun()
                       rerun_fr.natoms, top_global->natoms);
         }
 
-        if (ir->ePBC != epbcNONE)
+        if (ir->pbcType != PbcType::No)
         {
             if (!rerun_fr.bBox)
             {
@@ -437,7 +437,7 @@ void gmx::LegacySimulator::do_rerun()
                           "does not contain a box, while pbc is used",
                           rerun_fr.step, rerun_fr.time);
             }
-            if (max_cutoff2(ir->ePBC, rerun_fr.box) < gmx::square(fr->rlist))
+            if (max_cutoff2(ir->pbcType, rerun_fr.box) < gmx::square(fr->rlist))
             {
                 gmx_fatal(FARGS,
                           "Rerun trajectory frame step %" PRId64
@@ -459,7 +459,7 @@ void gmx::LegacySimulator::do_rerun()
         rerun_parallel_comm(cr, &rerun_fr, &isLastStep);
     }
 
-    if (ir->ePBC != epbcNONE)
+    if (ir->pbcType != PbcType::No)
     {
         /* Set the shift vectors.
          * Necessary here when have a static box different from the tpr box.
@@ -601,7 +601,7 @@ void gmx::LegacySimulator::do_rerun()
             }
             construct_vsites(vsite, as_rvec_array(state->x.data()), ir->delta_t,
                              as_rvec_array(state->v.data()), top.idef.iparams, top.idef.il,
-                             fr->ePBC, fr->bMolPBC, cr, state->box);
+                             fr->pbcType, fr->bMolPBC, cr, state->box);
 
             if (graph != nullptr)
             {
@@ -617,15 +617,15 @@ void gmx::LegacySimulator::do_rerun()
             t_vcm*              vcm              = nullptr;
             SimulationSignaller signaller(&signals, cr, ms, doInterSimSignal, doIntraSimSignal);
 
-            compute_globals(gstat, cr, ir, fr, ekind, state->x.rvec_array(), state->v.rvec_array(),
-                            state->box, state->lambda[efptVDW], mdatoms, nrnb, vcm, wcycle, enerd,
-                            force_vir, shake_vir, total_vir, pres, mu_tot, constr, &signaller,
-                            state->box, &totalNumberOfBondedInteractions, &bSumEkinhOld,
+            compute_globals(gstat, cr, ir, fr, ekind, makeConstArrayRef(state->x),
+                            makeConstArrayRef(state->v), state->box, state->lambda[efptVDW], mdatoms,
+                            nrnb, vcm, wcycle, enerd, force_vir, shake_vir, total_vir, pres, constr,
+                            &signaller, state->box, &totalNumberOfBondedInteractions, &bSumEkinhOld,
                             CGLO_GSTAT | CGLO_ENERGY
                                     | (shouldCheckNumberOfBondedInteractions ? CGLO_CHECK_NUMBER_OF_BONDED_INTERACTIONS
                                                                              : 0));
             checkNumberOfBondedInteractions(mdlog, cr, totalNumberOfBondedInteractions, top_global,
-                                            &top, state->x.rvec_array(), state->box,
+                                            &top, makeConstArrayRef(state->x), state->box,
                                             &shouldCheckNumberOfBondedInteractions);
         }