void write_sto_conf(const char *outfile, const char *title, t_atoms *atoms, rvec x[], rvec *v, int ePBC, matrix box) { FILE *out; int ftp; t_trxframe fr; ftp = fn2ftp(outfile); switch (ftp) { case efGRO: write_conf_p(outfile, title, atoms, 3, x, v, box); break; case efG96: clear_trxframe(&fr, TRUE); fr.bTitle = TRUE; fr.title = title; fr.natoms = atoms->nr; fr.bAtoms = TRUE; fr.atoms = atoms; fr.bX = TRUE; fr.x = x; if (v) { fr.bV = TRUE; fr.v = v; } fr.bBox = TRUE; copy_mat(box, fr.box); out = gmx_fio_fopen(outfile, "w"); write_g96_conf(out, &fr, -1, NULL); gmx_fio_fclose(out); break; case efPDB: case efBRK: case efENT: out = gmx_fio_fopen(outfile, "w"); write_pdbfile(out, title, atoms, x, ePBC, box, ' ', -1, NULL, TRUE); gmx_fio_fclose(out); break; case efESP: out = gmx_fio_fopen(outfile, "w"); write_espresso_conf_indexed(out, title, atoms, atoms->nr, NULL, x, v, box); gmx_fio_fclose(out); 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"); } }
static void write_conf(const char *outfile, const char *title, t_atoms *atoms, rvec *x, rvec *v, matrix box) { write_conf_p(outfile, title, atoms, 3, x, v, box); }