Add TNG writing and reading support
[alexxy/gromacs.git] / src / gromacs / legacyheaders / sim_util.h
1 /*
2  * This file is part of the GROMACS molecular simulation package.
3  *
4  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
5  * Copyright (c) 2001-2004, The GROMACS development team.
6  * Copyright (c) 2013, 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.
10  *
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.
15  *
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.
20  *
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.
25  *
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.
33  *
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.
36  */
37
38 #ifndef _sim_util_h
39 #define _sim_util_h
40
41 #include "typedefs.h"
42 #include "mdebin.h"
43 #include "update.h"
44 #include "vcm.h"
45 #include "../fileio/enxio.h"
46 #include "../fileio/mdoutf.h"
47 #include "../timing/walltime_accounting.h"
48
49 #ifdef __cplusplus
50 extern "C" {
51 #endif
52
53 typedef struct gmx_global_stat *gmx_global_stat_t;
54
55 void do_pbc_first(FILE *log, matrix box, t_forcerec *fr,
56                   t_graph *graph, rvec x[]);
57
58 void do_pbc_first_mtop(FILE *fplog, int ePBC, matrix box,
59                        gmx_mtop_t *mtop, rvec x[]);
60
61 void do_pbc_mtop(FILE *fplog, int ePBC, matrix box,
62                  gmx_mtop_t *mtop, rvec x[]);
63
64
65
66 /* ROUTINES from stat.c */
67 gmx_global_stat_t global_stat_init(t_inputrec *ir);
68
69 void global_stat_destroy(gmx_global_stat_t gs);
70
71 void global_stat(FILE *log, gmx_global_stat_t gs,
72                  t_commrec *cr, gmx_enerdata_t *enerd,
73                  tensor fvir, tensor svir, rvec mu_tot,
74                  t_inputrec *inputrec,
75                  gmx_ekindata_t *ekind,
76                  gmx_constr_t constr, t_vcm *vcm,
77                  int nsig, real *sig,
78                  gmx_mtop_t *top_global, t_state *state_local,
79                  gmx_bool bSumEkinhOld, int flags);
80 /* Communicate statistics over cr->mpi_comm_mysim */
81
82 int do_per_step(gmx_int64_t step, gmx_int64_t nstep);
83 /* Return TRUE if io should be done */
84
85 /* ROUTINES from sim_util.c */
86
87 void print_time(FILE *out, gmx_walltime_accounting_t walltime_accounting,
88                 gmx_int64_t step, t_inputrec *ir, t_commrec *cr);
89
90 void print_date_and_time(FILE *log, int pid, const char *title,
91                          const gmx_walltime_accounting_t walltime_accounting);
92
93 void finish_run(FILE *log, t_commrec *cr,
94                 t_inputrec *inputrec,
95                 t_nrnb nrnb[], gmx_wallcycle_t wcycle,
96                 gmx_walltime_accounting_t walltime_accounting,
97                 wallclock_gpu_t *gputimes,
98                 gmx_bool bWriteStat);
99
100 void calc_enervirdiff(FILE *fplog, int eDispCorr, t_forcerec *fr);
101
102 void calc_dispcorr(FILE *fplog, t_inputrec *ir, t_forcerec *fr,
103                    gmx_int64_t step, int natoms,
104                    matrix box, real lambda, tensor pres, tensor virial,
105                    real *prescorr, real *enercorr, real *dvdlcorr);
106
107 void initialize_lambdas(FILE *fplog, t_inputrec *ir, int *fep_state, real *lambda, double *lam0);
108
109 void do_constrain_first(FILE *log, gmx_constr_t constr,
110                         t_inputrec *inputrec, t_mdatoms *md,
111                         t_state *state, t_commrec *cr, t_nrnb *nrnb,
112                         t_forcerec *fr, gmx_localtop_t *top);
113
114 void init_md(FILE *fplog,
115              t_commrec *cr, t_inputrec *ir, const output_env_t oenv,
116              double *t, double *t0,
117              real *lambda, int *fep_state, double *lam0,
118              t_nrnb *nrnb, gmx_mtop_t *mtop,
119              gmx_update_t *upd,
120              int nfile, const t_filenm fnm[],
121              gmx_mdoutf_t *outf, t_mdebin **mdebin,
122              tensor force_vir, tensor shake_vir,
123              rvec mu_tot,
124              gmx_bool *bSimAnn, t_vcm **vcm, unsigned long Flags);
125 /* Routine in sim_util.c */
126
127 #ifdef __cplusplus
128 }
129 #endif
130
131 #endif  /* _sim_util_h */