4 * This source code is part of
8 * GROningen MAchine for Chemical Simulations
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
36 static char *SRCID_enxio_h
= "$Id$";
42 #ident "@(#) enerio.h 1.13 2/2/97"
43 #endif /* HAVE_IDENT */
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 **************************************************************/
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.
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.
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]) */
95 * An energy file is read like this:
100 * fp = open_enx(...);
103 * while (do_enx(fp,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 */
127 #endif /* _enerio_h */