}
if (bRead)
{
+ if ((block->nalloc_index > 0) && (NULL != block->index))
+ {
+ sfree(block->index);
+ }
block->nalloc_index = block->nr+1;
snew(block->index, block->nalloc_index);
}
{
if (file_version >= 57)
{
+ done_block(&mtop->mols);
mtop->mols = mtop_mols(mtop);
}
if (gmx_debug_at)
}
}
+static void done_gmx_groups_t(gmx_groups_t *g)
+{
+ int i;
+
+ for (i = 0; (i < egcNR); i++)
+ {
+ if (NULL != g->grps[i].nm_ind)
+ {
+ sfree(g->grps[i].nm_ind);
+ g->grps[i].nm_ind = NULL;
+ }
+ if (NULL != g->grpnr[i])
+ {
+ sfree(g->grpnr[i]);
+ g->grpnr[i] = NULL;
+ }
+ }
+ /* The contents of this array is in symtab, don't free it here */
+ sfree(g->grpname);
+}
+
gmx_bool read_tps_conf(const char *infile, char *title, t_topology *top, int *ePBC,
rvec **x, rvec **v, matrix box, gmx_bool bMass)
{
*ePBC = read_tpx(infile, NULL, box, &natoms,
(x == NULL) ? NULL : *x, (v == NULL) ? NULL : *v, NULL, mtop);
*top = gmx_mtop_t_to_t_topology(mtop);
+ /* In this case we need to throw away the group data too */
+ done_gmx_groups_t(&mtop->groups);
sfree(mtop);
strcpy(title, *top->name);
tpx_make_chain_identifiers(&top->atoms, &top->mols);