4 * This source code is part of
8 * GROningen MAchine for Chemical Simulations
12 * Copyright (c) 1991-2001
13 * BIOSON Research Institute, Dept. of Biophysical Chemistry
14 * University of Groningen, The Netherlands
16 * This program is free software; you can redistribute it and/or
17 * modify it under the terms of the GNU General Public License
18 * as published by the Free Software Foundation; either version 2
19 * of the License, or (at your option) any later version.
21 * If you want to redistribute modifications, please consider that
22 * scientific software is very special. Version control is crucial -
23 * bugs must be traceable. We will be happy to consider code for
24 * inclusion in the official distribution, but derived work must not
25 * be called official GROMACS. Details are found in the README & COPYING
26 * files - if they are missing, get the official version at www.gromacs.org.
28 * To help us fund GROMACS development, we humbly ask that you cite
29 * the papers on the package - you can find them in the top README file.
31 * Do check out http://www.gromacs.org , or mail us at gromacs@gromacs.org .
34 * GRoups of Organic Molecules in ACtion for Science
40 static char *SRCID_confio_h = "$Id$";
46 #ident "@(#) confio.h 1.16 11/23/92"
47 #endif /* HAVE_IDENT */
51 /* For reading coordinate files it is assumed that enough memory
52 * has been allocated beforehand.
58 extern void init_t_atoms(t_atoms *atoms, int natoms, bool bPdbinfo);
59 /* allocate memory for the arrays, set nr to natoms and nres to 0
60 * set pdbinfo to NULL or allocate memory for it */
62 extern void free_t_atoms(t_atoms *atoms);
63 /* free all the arrays and set the nr and nres to 0 */
65 int read_g96_conf(FILE *fp,char *infile,t_trxframe *fr);
66 /* read a Gromos96 coordinate or trajectory file, *
67 * returns the number of atoms *
68 * sets what's in the frame in info *
69 * read from fp, infile is only needed for error messages *
70 * nwanted is the number of wanted coordinates, *
71 * set this to -1 if you want to know the number of atoms in the file *
72 * title, atoms, x, v can all be NULL, in which case they won't be read */
74 void write_g96_conf(FILE *out,t_trxframe *fr,int nindex,atom_id *index);
75 /* write a Gromos96 coordinate file or trajectory frame *
76 * index can be NULL */
78 extern bool gro_next_x_or_v(FILE *status,t_trxframe *fr);
79 extern int gro_first_x_or_v(FILE *status,t_trxframe *fr);
80 /* read first/next x and/or v frame from gro file */
82 extern void write_hconf_indexed_p(FILE *out,char *title,t_atoms *atoms,
83 int nx,atom_id index[],int ndec,
84 rvec *x,rvec *v,matrix box);
86 extern void write_hconf_p(FILE *out,char *title,t_atoms *atoms, int ndec,
87 rvec *x,rvec *v,matrix box);
88 /* Write a Gromos file with precision ndec: number of decimal places in x,
89 * v has one place more. */
91 void write_sto_conf_indexed(char *outfile,char *title,t_atoms *atoms,
92 rvec x[],rvec *v,matrix box,
93 atom_id nindex,atom_id index[]);
94 /* like write_sto_conf, but indexed */
96 extern void write_sto_conf(char *outfile, char *title,t_atoms *atoms,
97 rvec x[],rvec *v, matrix box);
98 /* write atoms, x, v (if .gro and not NULL) and box (if not NULL)
99 * to an STO (.gro or .pdb) file */
101 extern void get_stx_coordnum (char *infile,int *natoms);
102 /* read the number of atoms from an STX file */
104 extern void read_stx_conf(char *infile, char *title,t_atoms *atoms,
105 rvec x[],rvec *v, matrix box);
106 /* read atoms, x, v and box from an STX file */
112 #endif /* _confio_h */