Increased extra table distance from 0.6 to 1.0.
[gromacs.git] / include / enxio.h
blob51e297d08f463d46e03b9103747f128c6bc8edff
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.1
11 * Copyright (c) 1991-2001, University of Groningen, The Netherlands
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
17 * If you want to redistribute modifications, please consider that
18 * scientific software is very special. Version control is crucial -
19 * bugs must be traceable. We will be happy to consider code for
20 * inclusion in the official distribution, but derived work must not
21 * be called official GROMACS. Details are found in the README & COPYING
22 * files - if they are missing, get the official version at www.gromacs.org.
24 * To help us fund GROMACS development, we humbly ask that you cite
25 * the papers on the package - you can find them in the top README file.
27 * For more info, check our website at http://www.gromacs.org
29 * And Hey:
30 * Grunge ROck MAChoS
33 #ifndef _enxio_h
34 #define _enxio_h
36 static char *SRCID_enxio_h = "$Id$";
37 #ifdef HAVE_CONFIG_H
38 #include <config.h>
39 #endif
41 #ifdef HAVE_IDENT
42 #ident "@(#) enerio.h 1.13 2/2/97"
43 #endif /* HAVE_IDENT */
45 #ifdef CPLUSPLUS
46 external "C" {
47 #endif
49 /**************************************************************
51 * The routines in the corresponding c-file enxio.c
52 * are based on the lower level routines in gmxfio.c
53 * The integer file pointer returned from open_enx
54 * can also be used with the routines in gmxfio.h
56 **************************************************************/
58 #include "sysstuff.h"
59 #include "typedefs.h"
61 /*
62 * Index for the additional blocks in the energy file.
63 * Blocks can be added without sacrificing backward and forward
64 * compatibility of the energy files.
66 enum {
67 enxOR, /* Time and ensemble averaged data for orientation restraints */
68 enxORI, /* Instantaneous data for orientation restraints */
69 enxNR /* Total number of extra blocks in the current code,
70 * note that the enxio code can read files written by
71 * future code which contain more blocks.
75 typedef struct {
76 real t; /* Timestamp of this frame */
77 int step; /* MD step */
78 int nre; /* Number of energies */
79 int ndisre; /* Number of distance restraints */
80 int nblock; /* Number of following energy blocks */
81 int *nr; /* Number of things in additional blocks (nblock) */
82 int e_size; /* Size (in bytes) of energies */
83 int d_size; /* Size (in bytes) of disre blocks */
84 int nr_alloc; /* Allocated size of nr and block */
85 int e_alloc; /* Allocated size (in elements) of ener */
86 int d_alloc; /* Allocated size (in elements) of rav and rt */
87 int *b_alloc; /* Allocated size (in elements) of each block */
88 t_energy *ener; /* The energies */
89 real *rav; /* Time averaged data for distance restraints */
90 real *rt; /* Instantaneous data for distance restraints */
91 real **block; /* Additional energy blocks ( nblock x b_alloc[b]) */
92 } t_enxframe;
94 /*
95 * An energy file is read like this:
97 * int fp;
98 * t_enxframe *fr;
100 * fp = open_enx(...);
101 * do_enxnms(fp,...);
102 * snew(fr,1);
103 * while (do_enx(fp,fr)) {
104 * ...
106 * free_enxframe(fr);
107 * sfree(fr);
110 /* New energy reading and writing interface */
111 extern void free_enxframe(t_enxframe *fr);
112 /* Frees all allocated memory in fr */
114 extern int open_enx(char *fn,char *mode);
116 extern void close_enx(int fp_ene);
118 extern void do_enxnms(int fp_ene,int *nre,char ***nms);
120 extern bool do_enx(int fp_ene,t_enxframe *fr);
121 /* Reads enx_frames, memory in fr is (re)allocated if necessary */
123 #ifdef CPLUSPLUS
125 #endif
127 #endif /* _enerio_h */