Introduce plumbing for ObservablesReducer
[alexxy/gromacs.git] / src / gromacs / mdlib / update_vv.cpp
index a5a9797a60c999d217a4fbb981dd8273877d96f2..279e77c8957be1982090aa7ad6c65845767d1638 100644 (file)
@@ -84,6 +84,7 @@ void integrateVVFirstStep(int64_t                   step,
                           t_vcm*                    vcm,
                           const gmx_localtop_t&     top,
                           gmx_enerdata_t*           enerd,
+                          gmx::ObservablesReducer*  observablesReducer,
                           gmx_ekindata_t*           ekind,
                           gmx_global_stat*          gstat,
                           real*                     last_ekin,
@@ -215,7 +216,9 @@ void integrateVVFirstStep(int64_t                   step,
                             nullSignaller,
                             state->box,
                             bSumEkinhOld,
-                            cglo_flags);
+                            cglo_flags,
+                            step,
+                            observablesReducer);
             /* explanation of above:
                 a) We compute Ekin at the full time step
                 if 1) we are using the AveVel Ekin, and it's not the
@@ -300,7 +303,9 @@ void integrateVVFirstStep(int64_t                   step,
                                 nullSignaller,
                                 state->box,
                                 bSumEkinhOld,
-                                CGLO_GSTAT | CGLO_TEMPERATURE);
+                                CGLO_GSTAT | CGLO_TEMPERATURE,
+                                step,
+                                observablesReducer);
                 wallcycle_start(wcycle, WallCycleCounter::Update);
             }
         }
@@ -331,36 +336,37 @@ void integrateVVFirstStep(int64_t                   step,
     }
 }
 
-void integrateVVSecondStep(int64_t                                                  step,
-                           const t_inputrec*                                        ir,
-                           t_forcerec*                                              fr,
-                           t_commrec*                                               cr,
-                           t_state*                                                 state,
-                           t_mdatoms*                                               mdatoms,
-                           t_fcdata*                                                fcdata,
-                           t_extmass*                                               MassQ,
-                           t_vcm*                                                   vcm,
-                           pull_t*                                                  pull_work,
-                           gmx_enerdata_t*                                          enerd,
-                           gmx_ekindata_t*                                          ekind,
-                           gmx_global_stat*                                         gstat,
-                           real*                                                    dvdl_constr,
-                           bool                                                     bCalcVir,
-                           tensor                                                   total_vir,
-                           tensor                                                   shake_vir,
-                           tensor                                                   force_vir,
-                           tensor                                                   pres,
-                           matrix                                                   M,
-                           matrix                                                   lastbox,
-                           bool                                                     do_log,
-                           bool                                                     do_ene,
-                           bool                                                     bGStat,
-                           bool*                                                    bSumEkinhOld,
-                           gmx::ForceBuffers*                                       f,
-                           std::vector<gmx::RVec>*                                  cbuf,
-                           gmx::Update*                                             upd,
-                           gmx::Constraints*                                        constr,
-                           gmx::SimulationSignaller*                                nullSignaller,
+void integrateVVSecondStep(int64_t                   step,
+                           const t_inputrec*         ir,
+                           t_forcerec*               fr,
+                           t_commrec*                cr,
+                           t_state*                  state,
+                           t_mdatoms*                mdatoms,
+                           t_fcdata*                 fcdata,
+                           t_extmass*                MassQ,
+                           t_vcm*                    vcm,
+                           pull_t*                   pull_work,
+                           gmx_enerdata_t*           enerd,
+                           gmx::ObservablesReducer*  observablesReducer,
+                           gmx_ekindata_t*           ekind,
+                           gmx_global_stat*          gstat,
+                           real*                     dvdl_constr,
+                           bool                      bCalcVir,
+                           tensor                    total_vir,
+                           tensor                    shake_vir,
+                           tensor                    force_vir,
+                           tensor                    pres,
+                           matrix                    M,
+                           matrix                    lastbox,
+                           bool                      do_log,
+                           bool                      do_ene,
+                           bool                      bGStat,
+                           bool*                     bSumEkinhOld,
+                           gmx::ForceBuffers*        f,
+                           std::vector<gmx::RVec>*   cbuf,
+                           gmx::Update*              upd,
+                           gmx::Constraints*         constr,
+                           gmx::SimulationSignaller* nullSignaller,
                            gmx::EnumerationArray<TrotterSequence, std::vector<int>> trotter_seq,
                            t_nrnb*                                                  nrnb,
                            gmx_wallcycle*                                           wcycle)
@@ -461,7 +467,9 @@ void integrateVVSecondStep(int64_t
                         nullSignaller,
                         lastbox,
                         bSumEkinhOld,
-                        (bGStat ? CGLO_GSTAT : 0) | CGLO_TEMPERATURE);
+                        (bGStat ? CGLO_GSTAT : 0) | CGLO_TEMPERATURE,
+                        step,
+                        observablesReducer);
         wallcycle_start(wcycle, WallCycleCounter::Update);
         trotter_update(ir,
                        step,