Bulk change to const ref for mtop
[alexxy/gromacs.git] / src / gromacs / tools / convert_tpr.cpp
index 66922ac5c6b77fbfede924016b4f247d1035bbd0..3aaaf35f9eb543f071807a1033c4e61107f1bde4 100644 (file)
@@ -4,7 +4,7 @@
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
  * Copyright (c) 2013,2014,2015,2016,2017 by the GROMACS development team.
- * Copyright (c) 2018,2019,2020, by the GROMACS development team, led by
+ * Copyright (c) 2018,2019,2020,2021, 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.
@@ -235,7 +235,7 @@ static void reduce_topology_x(int gnx, int index[], gmx_mtop_t* mtop, rvec x[],
 {
     gmx_localtop_t top(mtop->ffparams);
     gmx_mtop_generate_local_top(*mtop, &top, false);
-    t_atoms atoms = gmx_mtop_global_atoms(mtop);
+    t_atoms atoms = gmx_mtop_global_atoms(*mtop);
 
     const std::vector<bool> bKeep    = bKeepIt(gnx, atoms.nr, index);
     const std::vector<int>  invindex = invind(gnx, atoms.nr, index);
@@ -444,7 +444,7 @@ int ConvertTpr::run()
 
         if (haveReadIndexFile_ || !(maxStepsIsSet_ || extendTimeIsSet_ || runToMaxTimeIsSet_))
         {
-            atoms         = gmx_mtop_global_atoms(&mtop);
+            atoms         = gmx_mtop_global_atoms(mtop);
             int   gnx     = 0;
             int*  index   = nullptr;
             char* grpname = nullptr;
@@ -495,7 +495,7 @@ int ConvertTpr::run()
                 "                                 time %10.3f and length %10.3f ps\n",
                 stateTime,
                 ir->nsteps * ir->delta_t);
-        write_tpx_state(outputTprFileName_.c_str(), ir, &state, &mtop);
+        write_tpx_state(outputTprFileName_.c_str(), ir, &state, mtop);
     }
     else
     {