case efENT:
case efPQR:
out = gmx_fio_fopen(outfile, "w");
- write_pdbfile_indexed(out, title, atoms, x, ePBC, box, ' ', -1, nindex, index, nullptr, TRUE, ftp == efPQR ? TRUE : FALSE);
+ write_pdbfile_indexed(out, title, atoms, x, ePBC, box, ' ', -1, nindex, index, nullptr, TRUE, ftp == efPQR);
gmx_fio_fclose(out);
break;
case efESP:
break;
case efTPR:
gmx_fatal(FARGS, "Sorry, can not write a topology to %s", outfile);
- break;
default:
gmx_incons("Not supported in write_sto_conf_indexed");
}
break;
case efTPR:
gmx_fatal(FARGS, "Sorry, can not write a topology to %s", outfile);
- break;
default:
gmx_incons("Not supported in write_sto_conf");
}
}
}
+// TODO molecule index handling is suspected of being broken here
static void tpx_make_chain_identifiers(t_atoms *atoms, t_block *mols)
{
/* We always assign a new chain number, but save the chain id characters
}
}
-static void readConfAndAtoms(const char *infile,
- t_symtab *symtab, char **name, t_atoms *atoms,
- int *ePBC,
- rvec **x, rvec **v, matrix box)
+void readConfAndAtoms(const char *infile,
+ t_symtab *symtab, char **name, t_atoms *atoms,
+ int *ePBC,
+ rvec **x, rvec **v, matrix box)
{
int natoms;
get_stx_coordnum(infile, &natoms);
rvec **x, rvec **v, matrix box, gmx_bool requireMasses)
{
bool haveTopology;
- gmx_mtop_t *mtop;
+ gmx_mtop_t mtop;
- // Note: We should have an initializer instead of relying on snew
- snew(mtop, 1);
- readConfAndTopology(infile, &haveTopology, mtop, ePBC, x, v, box);
+ readConfAndTopology(infile, &haveTopology, &mtop, ePBC, x, v, box);
- *top = gmx_mtop_t_to_t_topology(mtop, true);
- sfree(mtop);
+ *top = gmx_mtop_t_to_t_topology(&mtop, true);
tpx_make_chain_identifiers(&top->atoms, &top->mols);