Tagged files with gromacs 3.0 header and added some license info
[alexxy/gromacs.git] / include / confio.h
1 /*
2  * $Id$
3  * 
4  *                This source code is part of
5  * 
6  *                 G   R   O   M   A   C   S
7  * 
8  *          GROningen MAchine for Chemical Simulations
9  * 
10  *                        VERSION 3.0
11  * 
12  * Copyright (c) 1991-2001
13  * BIOSON Research Institute, Dept. of Biophysical Chemistry
14  * University of Groningen, The Netherlands
15  * 
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.
20  * 
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.
27  * 
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.
30  * 
31  * Do check out http://www.gromacs.org , or mail us at gromacs@gromacs.org .
32  * 
33  * And Hey:
34  * GRoups of Organic Molecules in ACtion for Science
35  */
36
37 #ifndef _confio_h
38 #define _confio_h
39
40 static char *SRCID_confio_h = "$Id$";
41 #ifdef HAVE_CONFIG_H
42 #include <config.h>
43 #endif
44
45 #ifdef HAVE_IDENT
46 #ident  "@(#) confio.h 1.16 11/23/92"
47 #endif /* HAVE_IDENT */
48
49 #include "typedefs.h"
50
51 /* For reading coordinate files it is assumed that enough memory
52  * has been allocated beforehand.
53  */
54 #ifdef CPLUSPLUS
55 extern "C" {
56 #endif
57   
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 */  
61
62 extern void free_t_atoms(t_atoms *atoms);
63 /* free all the arrays and set the nr and nres to 0 */
64
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 */
73
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                                    */
77
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 */
81
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);
85                 
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. */ 
90
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 */ 
95
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 */ 
100
101 extern void get_stx_coordnum (char *infile,int *natoms);
102 /* read the number of atoms from an STX file */
103
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 */
107
108 #ifdef CPLUSPLUS
109 }
110 #endif
111
112 #endif  /* _confio_h */