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, 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.
45 #include "../fileio/enxio.h"
46 #include "types/state.h"
52 /* The functions & data structures here determine the content for outputting
53 the .edr file; the file format and actual writing is done with functions
56 /* forward declaration */
57 typedef struct t_mde_delta_h_coll t_mde_delta_h_coll;
60 /* This is the collection of energy averages collected during mdrun, and to
61 be written out to the .edr file. */
65 int ie, iconrmsd, ib, ivol, idens, ipv, ienthalpy;
66 int isvir, ifvir, ipres, ivir, isurft, ipc, itemp, itc, itcb, iu, imu;
68 int nE, nEg, nEc, nTC, nTCP, nU, nNHC;
78 gmx_bool bNHC_trotter;
79 gmx_bool bPrintNHChains;
81 gmx_bool bMu; /* true if dipole is calculated */
91 gmx_bool bEner[F_NRE];
95 FILE *fp_dhdl; /* the dhdl.xvg output file */
96 double *dE; /* energy components for dhdl.xvg output */
97 t_mde_delta_h_coll *dhc; /* the delta U components (raw data + histogram) */
102 /* delta_h block type enum: the kinds of energies written out. */
105 dhbtDH = 0, /* delta H BAR energy difference*/
106 dhbtDHDL = 1, /* dH/dlambda derivative */
107 dhbtEN, /* System energy */
108 dhbtPV, /* pV term */
109 dhbtEXPANDED, /* expanded ensemble statistics */
115 t_mdebin *init_mdebin(ener_file_t fp_ene,
116 const gmx_mtop_t *mtop,
117 const t_inputrec *ir,
119 /* Initiate MD energy bin and write header to energy file. */
121 FILE *open_dhdl(const char *filename, const t_inputrec *ir,
122 const output_env_t oenv);
123 /* Open the dhdl file for output */
125 /* update the averaging structures. Called every time
126 the energies are evaluated. */
127 void upd_mdebin(t_mdebin *md,
132 gmx_enerdata_t *enerd,
141 gmx_ekindata_t *ekind,
143 gmx_constr_t constr);
145 void upd_mdebin_step(t_mdebin *md);
146 /* Updates only the step count in md */
148 void print_ebin_header(FILE *log, gmx_int64_t steps, double time, real lamb);
150 void print_ebin(ener_file_t fp_ene, gmx_bool bEne, gmx_bool bDR, gmx_bool bOR,
152 gmx_int64_t step, double time,
153 int mode, gmx_bool bCompact,
154 t_mdebin *md, t_fcdata *fcd,
155 gmx_groups_t *groups, t_grpopts *opts);
159 /* Between .edr writes, the averages are history dependent,
160 and that history needs to be retained in checkpoints.
161 These functions set/read the energyhistory_t structure
162 that is written to checkpoints in checkpoint.c */
164 /* Set the energyhistory_t data structure from a mdebin structure */
165 void update_energyhistory(energyhistory_t * enerhist, t_mdebin * mdebin);
167 /* Read the energyhistory_t data structure to a mdebin structure*/
168 void restore_energyhistory_from_state(t_mdebin * mdebin,
169 energyhistory_t * enerhist);
175 #endif /* _mdebin_h */