Completely remove charge groups
[alexxy/gromacs.git] / src / gromacs / fileio / tpxio.cpp
index 33279bd528215a7daaa3f90bb5521523afa40c47..971ebab155311dd3606cd83838932d2fc193ae98 100644 (file)
@@ -2483,7 +2483,17 @@ static void do_moltype(gmx::ISerializer         *serializer,
 
     do_ilists(serializer, &molt->ilist, file_version);
 
-    do_block(serializer, &molt->cgs);
+    /* TODO: Remove the obsolete charge group index from the file */
+    t_block cgs;
+    cgs.nr           = molt->atoms.nr;
+    cgs.nalloc_index = cgs.nr + 1;
+    snew(cgs.index, cgs.nalloc_index);
+    for (int i = 0; i < cgs.nr + 1; i++)
+    {
+        cgs.index[i] = i;
+    }
+    do_block(serializer, &cgs);
+    sfree(cgs.index);
 
     /* This used to be in the atoms struct */
     do_blocka(serializer, &molt->excls);