4 * This source code is part of
8 * GROningen MAchine for Chemical Simulations
12 * Copyright (c) 1991-1999
13 * BIOSON Research Institute, Dept. of Biophysical Chemistry
14 * University of Groningen, The Netherlands
17 * GROMACS: A message-passing parallel molecular dynamics implementation
18 * H.J.C. Berendsen, D. van der Spoel and R. van Drunen
19 * Comp. Phys. Comm. 91, 43-56 (1995)
21 * Also check out our WWW page:
22 * http://md.chem.rug.nl/~gmx
27 * Good ROcking Metal Altar for Chronical Sinners
33 static char *SRCID_confio_h = "$Id$";
40 #ident "@(#) confio.h 1.16 11/23/92"
41 #endif /* HAVE_IDENT */
45 /* For reading coordinate files it is assumed that enough memory
46 * has been allocated beforehand.
52 extern void init_t_atoms(t_atoms *atoms, int natoms, bool bPdbinfo);
53 /* allocate memory for the arrays, set nr to natoms and nres to 0
54 * set pdbinfo to NULL or allocate memory for it */
56 extern void free_t_atoms(t_atoms *atoms);
57 /* free all the arrays and set the nr and nres to 0 */
59 int read_g96_conf(FILE *fp,char *infile,t_trxframe *fr);
60 /* read a Gromos96 coordinate or trajectory file, *
61 * returns the number of atoms *
62 * sets what's in the frame in info *
63 * read from fp, infile is only needed for error messages *
64 * nwanted is the number of wanted coordinates, *
65 * set this to -1 if you want to know the number of atoms in the file *
66 * title, atoms, x, v can all be NULL, in which case they won't be read */
68 void write_g96_conf(FILE *out,t_trxframe *fr,int nindex,atom_id *index);
69 /* write a Gromos96 coordinate file or trajectory frame *
70 * index can be NULL */
72 extern bool gro_next_x_or_v(FILE *status,t_trxframe *fr);
73 extern int gro_first_x_or_v(FILE *status,t_trxframe *fr);
74 /* read first/next x and/or v frame from gro file */
76 extern void write_hconf_indexed_p(FILE *out,char *title,t_atoms *atoms,
77 int nx,atom_id index[],int ndec,
78 rvec *x,rvec *v,matrix box);
80 extern void write_hconf_p(FILE *out,char *title,t_atoms *atoms, int ndec,
81 rvec *x,rvec *v,matrix box);
82 /* Write a Gromos file with precision ndec: number of decimal places in x,
83 * v has one place more. */
85 void write_sto_conf_indexed(char *outfile,char *title,t_atoms *atoms,
86 rvec x[],rvec *v,matrix box,
87 atom_id nindex,atom_id index[]);
88 /* like write_sto_conf, but indexed */
90 extern void write_sto_conf(char *outfile, char *title,t_atoms *atoms,
91 rvec x[],rvec *v, matrix box);
92 /* write atoms, x, v (if .gro and not NULL) and box (if not NULL)
93 * to an STO (.gro or .pdb) file */
95 extern void get_stx_coordnum (char *infile,int *natoms);
96 /* read the number of atoms from an STX file */
98 extern void read_stx_conf(char *infile, char *title,t_atoms *atoms,
99 rvec x[],rvec *v, matrix box);
100 /* read atoms, x, v and box from an STX file */
106 #endif /* _confio_h */