Bulk change to const ref for mtop
[alexxy/gromacs.git] / src / gromacs / mdlib / trajectory_writing.cpp
index 405174ef7fc228d57602f36bf86c8a390bc5fba4..a7787ea97d5430c1a65ab376a11aeb4070411464 100644 (file)
@@ -66,7 +66,7 @@ void do_md_trajectory_writing(FILE*                          fplog,
                               t_state*                       state,
                               t_state*                       state_global,
                               ObservablesHistory*            observablesHistory,
-                              const gmx_mtop_t*              top_global,
+                              const gmx_mtop_t&              top_global,
                               t_forcerec*                    fr,
                               gmx_mdoutf_t                   outf,
                               const gmx::EnergyOutput&       energyOutput,
@@ -147,7 +147,7 @@ void do_md_trajectory_writing(FILE*                          fplog,
         // This duplication is needed while both legacy and modular code paths are in use.
         // TODO: Remove duplication asap, make sure to keep in sync in the meantime.
         mdoutf_write_to_trajectory_files(
-                fplog, cr, outf, mdof_flags, top_global->natoms, step, t, state, state_global, observablesHistory, f, &checkpointDataHolder);
+                fplog, cr, outf, mdof_flags, top_global.natoms, step, t, state, state_global, observablesHistory, f, &checkpointDataHolder);
         if (bLastStep && step_rel == ir->nsteps && bDoConfOut && MASTER(cr) && !bRerunMD)
         {
             if (fr->bMolPBC && state == state_global)
@@ -177,10 +177,10 @@ void do_md_trajectory_writing(FILE*                          fplog,
             if (fr->bMolPBC && !ir->bPeriodicMols)
             {
                 /* Make molecules whole only for confout writing */
-                do_pbc_mtop(ir->pbcType, state->box, top_global, x_for_confout);
+                do_pbc_mtop(ir->pbcType, state->box, &top_global, x_for_confout);
             }
             write_sto_conf_mtop(ftp2fn(efSTO, nfile, fnm),
-                                *top_global->name,
+                                *top_global.name,
                                 top_global,
                                 x_for_confout,
                                 state_global->v.rvec_array(),