Rework state checkpoint enum handling
[alexxy/gromacs.git] / src / gromacs / mdrun / runner.cpp
index dce96b70ae4d9860563d31bcf77709793c79bae5..350ace3f2f7b8fc59c3b98b97f4334c40626628c 100644 (file)
@@ -1005,7 +1005,7 @@ int Mdrunner::mdrunner()
     if (SIMMASTER(cr))
     {
         /* In rerun, set velocities to zero if present */
-        if (doRerun && ((globalState->flags & (1 << estV)) != 0))
+        if (doRerun && ((globalState->flags & enumValueToBitMask(StateEntry::V)) != 0))
         {
             // rerun does not use velocities
             GMX_LOG(mdlog.info)
@@ -1017,7 +1017,7 @@ int Mdrunner::mdrunner()
             {
                 clear_rvec(globalState->v[i]);
             }
-            globalState->flags &= ~(1 << estV);
+            globalState->flags &= ~enumValueToBitMask(StateEntry::V);
         }
 
         /* now make sure the state is initialized and propagated */