Removed four includes from legacyheaders/typedefs.h
[gromacs.git] / src / gromacs / legacyheaders / mdebin.h
blob2628802ad5325cf1997c35bf8bce5605d1b653f8
1 /*
2 * This file is part of the GROMACS molecular simulation package.
4 * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
5 * Copyright (c) 2001-2004, The GROMACS development team.
6 * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
7 * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
8 * and including many others, as listed in the AUTHORS file in the
9 * top-level source directory and at http://www.gromacs.org.
11 * GROMACS is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU Lesser General Public License
13 * as published by the Free Software Foundation; either version 2.1
14 * of the License, or (at your option) any later version.
16 * GROMACS is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * Lesser General Public License for more details.
21 * You should have received a copy of the GNU Lesser General Public
22 * License along with GROMACS; if not, see
23 * http://www.gnu.org/licenses, or write to the Free Software Foundation,
24 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
26 * If you want to redistribute modifications to GROMACS, please
27 * consider that scientific software is very special. Version
28 * control is crucial - bugs must be traceable. We will be happy to
29 * consider code for inclusion in the official distribution, but
30 * derived work must not be called official GROMACS. Details are found
31 * in the README & COPYING files - if they are missing, get the
32 * official version at http://www.gromacs.org.
34 * To help us fund GROMACS development, we humbly ask that you cite
35 * the research papers on the package. Check out http://www.gromacs.org.
38 #ifndef _mdebin_h
39 #define _mdebin_h
41 #include <stdio.h>
43 #include "gromacs/fileio/enxio.h"
44 #include "gromacs/legacyheaders/ebin.h"
45 #include "gromacs/legacyheaders/typedefs.h"
46 #include "gromacs/legacyheaders/types/state.h"
48 struct gmx_constr;
49 struct gmx_ekindata_t;
50 struct gmx_output_env_t;
52 #ifdef __cplusplus
53 extern "C" {
54 #endif
56 /* The functions & data structures here determine the content for outputting
57 the .edr file; the file format and actual writing is done with functions
58 defined in enxio.h */
60 /* forward declaration */
61 typedef struct t_mde_delta_h_coll t_mde_delta_h_coll;
64 /* This is the collection of energy averages collected during mdrun, and to
65 be written out to the .edr file. */
66 typedef struct {
67 double delta_t;
68 t_ebin *ebin;
69 int ie, iconrmsd, ib, ivol, idens, ipv, ienthalpy;
70 int isvir, ifvir, ipres, ivir, isurft, ipc, itemp, itc, itcb, iu, imu;
71 int ivcos, ivisc;
72 int nE, nEg, nEc, nTC, nTCP, nU, nNHC;
73 int *igrp;
74 char **grpnms;
75 int mde_n, mdeb_n;
76 real *tmp_r;
77 rvec *tmp_v;
78 gmx_bool bConstr;
79 gmx_bool bConstrVir;
80 gmx_bool bTricl;
81 gmx_bool bDynBox;
82 gmx_bool bNHC_trotter;
83 gmx_bool bPrintNHChains;
84 gmx_bool bMTTK;
85 gmx_bool bMu; /* true if dipole is calculated */
86 gmx_bool bDiagPres;
87 gmx_bool bVir;
88 gmx_bool bPress;
89 gmx_bool bSurft;
90 int f_nre;
91 int epc;
92 real ref_p;
93 int etc;
94 int nCrmsd;
95 gmx_bool bEner[F_NRE];
96 gmx_bool bEInd[egNR];
97 char **print_grpnms;
99 FILE *fp_dhdl; /* the dhdl.xvg output file */
100 double *dE; /* energy components for dhdl.xvg output */
101 t_mde_delta_h_coll *dhc; /* the delta U components (raw data + histogram) */
102 real *temperatures;
103 } t_mdebin;
106 /* delta_h block type enum: the kinds of energies written out. */
107 enum
109 dhbtDH = 0, /* delta H BAR energy difference*/
110 dhbtDHDL = 1, /* dH/dlambda derivative */
111 dhbtEN, /* System energy */
112 dhbtPV, /* pV term */
113 dhbtEXPANDED, /* expanded ensemble statistics */
114 dhbtNR
119 t_mdebin *init_mdebin(ener_file_t fp_ene,
120 const gmx_mtop_t *mtop,
121 const t_inputrec *ir,
122 FILE *fp_dhdl);
123 /* Initiate MD energy bin and write header to energy file. */
125 FILE *open_dhdl(const char *filename, const t_inputrec *ir,
126 const gmx_output_env_t *oenv);
127 /* Open the dhdl file for output */
129 /* update the averaging structures. Called every time
130 the energies are evaluated. */
131 void upd_mdebin(t_mdebin *md,
132 gmx_bool bDoDHDL,
133 gmx_bool bSum,
134 double time,
135 real tmass,
136 gmx_enerdata_t *enerd,
137 t_state *state,
138 t_lambda *fep,
139 t_expanded *expand,
140 matrix lastbox,
141 tensor svir,
142 tensor fvir,
143 tensor vir,
144 tensor pres,
145 struct gmx_ekindata_t *ekind,
146 rvec mu_tot,
147 struct gmx_constr *constr);
149 void upd_mdebin_step(t_mdebin *md);
150 /* Updates only the step count in md */
152 void print_ebin_header(FILE *log, gmx_int64_t steps, double time, real lamb);
154 void print_ebin(ener_file_t fp_ene, gmx_bool bEne, gmx_bool bDR, gmx_bool bOR,
155 FILE *log,
156 gmx_int64_t step, double time,
157 int mode, gmx_bool bCompact,
158 t_mdebin *md, t_fcdata *fcd,
159 gmx_groups_t *groups, t_grpopts *opts);
163 /* Between .edr writes, the averages are history dependent,
164 and that history needs to be retained in checkpoints.
165 These functions set/read the energyhistory_t structure
166 that is written to checkpoints in checkpoint.c */
168 /* Set the energyhistory_t data structure from a mdebin structure */
169 void update_energyhistory(energyhistory_t * enerhist, t_mdebin * mdebin);
171 /* Read the energyhistory_t data structure to a mdebin structure*/
172 void restore_energyhistory_from_state(t_mdebin * mdebin,
173 energyhistory_t * enerhist);
175 #ifdef __cplusplus
177 #endif
179 #endif /* _mdebin_h */