Convert gmx_mtop_t to C++
[alexxy/gromacs.git] / src / gromacs / topology / mtop_lookup.h
index 70853e0e703cba69569d31373415a5a4188c5ffc..fd4208c9f55d2c55602a9f56745f145392de5919 100644 (file)
@@ -74,11 +74,11 @@ mtopGetMolblockIndex(const gmx_mtop_t *mtop,
 {
     GMX_ASSERT(globalAtomIndex >= 0 && globalAtomIndex < mtop->natoms, "The atom index to look up should be within range");
     GMX_ASSERT(moleculeBlock != nullptr, "molBlock can not be NULL");
-    GMX_ASSERT(*moleculeBlock >= 0 && *moleculeBlock < mtop->nmolblock, "The starting molecule block index for the search should be within range");
+    GMX_ASSERT(*moleculeBlock >= 0 && *moleculeBlock < static_cast<int>(mtop->molblock.size()), "The starting molecule block index for the search should be within range");
 
     /* Search the molecue block index using bisection */
     int molBlock0 = -1;
-    int molBlock1 = mtop->nmolblock;
+    int molBlock1 = mtop->molblock.size();
 
     int globalAtomStart;
     while (TRUE)