Merge branch release-2018 into release-2019
[alexxy/gromacs.git] / src / gromacs / topology / mtop_util.cpp
index cea904562fa86ea70bd26cb129d07e43ef1030a5..aff5c43eac33ed90b9b6f57b47dbdbe8ce0a66e9 100644 (file)
@@ -1234,16 +1234,15 @@ std::vector<int> get_atom_index(const gmx_mtop_t *mtop)
 {
 
     std::vector<int>          atom_index;
-    gmx_mtop_atomloop_block_t aloopb = gmx_mtop_atomloop_block_init(mtop);
+    gmx_mtop_atomloop_all_t   aloop = gmx_mtop_atomloop_all_init(mtop);
     const t_atom             *atom;
-    int                       nmol, j = 0;
-    while (gmx_mtop_atomloop_block_next(aloopb, &atom, &nmol))
+    int                       at_global;
+    while (gmx_mtop_atomloop_all_next(aloop, &at_global, &atom))
     {
         if (atom->ptype == eptAtom)
         {
-            atom_index.push_back(j);
+            atom_index.push_back(at_global);
         }
-        j++;
     }
     return atom_index;
 }