Replace gmx_large_int_t with gmx_int64_t
[alexxy/gromacs.git] / src / gromacs / legacyheaders / sim_util.h
1 /*
2  *
3  *                This source code is part of
4  *
5  *                 G   R   O   M   A   C   S
6  *
7  *          GROningen MAchine for Chemical Simulations
8  *
9  *                        VERSION 3.2.0
10  * Written by David van der Spoel, Erik Lindahl, Berk Hess, and others.
11  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
12  * Copyright (c) 2001-2004, The GROMACS development team,
13  * check out http://www.gromacs.org for more information.
14
15  * This program is free software; you can redistribute it and/or
16  * modify it under the terms of the GNU General Public License
17  * as published by the Free Software Foundation; either version 2
18  * of the License, or (at your option) any later version.
19  *
20  * If you want to redistribute modifications, please consider that
21  * scientific software is very special. Version control is crucial -
22  * bugs must be traceable. We will be happy to consider code for
23  * inclusion in the official distribution, but derived work must not
24  * be called official GROMACS. Details are found in the README & COPYING
25  * files - if they are missing, get the official version at www.gromacs.org.
26  *
27  * To help us fund GROMACS development, we humbly ask that you cite
28  * the papers on the package - you can find them in the top README file.
29  *
30  * For more info, check our website at http://www.gromacs.org
31  *
32  * And Hey:
33  * Gromacs Runs On Most of All Computer Systems
34  */
35
36 #ifndef _sim_util_h
37 #define _sim_util_h
38
39 #include "typedefs.h"
40 #include "mdebin.h"
41 #include "update.h"
42 #include "vcm.h"
43 #include "../fileio/enxio.h"
44 #include "../fileio/mdoutf.h"
45 #include "../timing/walltime_accounting.h"
46
47 #ifdef __cplusplus
48 extern "C" {
49 #endif
50
51 typedef struct gmx_global_stat *gmx_global_stat_t;
52
53 void do_pbc_first(FILE *log, matrix box, t_forcerec *fr,
54                   t_graph *graph, rvec x[]);
55
56 void do_pbc_first_mtop(FILE *fplog, int ePBC, matrix box,
57                        gmx_mtop_t *mtop, rvec x[]);
58
59 void do_pbc_mtop(FILE *fplog, int ePBC, matrix box,
60                  gmx_mtop_t *mtop, rvec x[]);
61
62
63
64 /* ROUTINES from stat.c */
65 gmx_global_stat_t global_stat_init(t_inputrec *ir);
66
67 void global_stat_destroy(gmx_global_stat_t gs);
68
69 void global_stat(FILE *log, gmx_global_stat_t gs,
70                  t_commrec *cr, gmx_enerdata_t *enerd,
71                  tensor fvir, tensor svir, rvec mu_tot,
72                  t_inputrec *inputrec,
73                  gmx_ekindata_t *ekind,
74                  gmx_constr_t constr, t_vcm *vcm,
75                  int nsig, real *sig,
76                  gmx_mtop_t *top_global, t_state *state_local,
77                  gmx_bool bSumEkinhOld, int flags);
78 /* Communicate statistics over cr->mpi_comm_mysim */
79
80 int do_per_step(gmx_int64_t step, gmx_int64_t nstep);
81 /* Return TRUE if io should be done */
82
83 /* ROUTINES from sim_util.c */
84
85 void print_time(FILE *out, gmx_walltime_accounting_t walltime_accounting,
86                 gmx_int64_t step, t_inputrec *ir, t_commrec *cr);
87
88 void print_date_and_time(FILE *log, int pid, const char *title,
89                          const gmx_walltime_accounting_t walltime_accounting);
90
91 void finish_run(FILE *log, t_commrec *cr,
92                 t_inputrec *inputrec,
93                 t_nrnb nrnb[], gmx_wallcycle_t wcycle,
94                 gmx_walltime_accounting_t walltime_accounting,
95                 wallclock_gpu_t *gputimes,
96                 gmx_bool bWriteStat);
97
98 void calc_enervirdiff(FILE *fplog, int eDispCorr, t_forcerec *fr);
99
100 void calc_dispcorr(FILE *fplog, t_inputrec *ir, t_forcerec *fr,
101                    gmx_int64_t step, int natoms,
102                    matrix box, real lambda, tensor pres, tensor virial,
103                    real *prescorr, real *enercorr, real *dvdlcorr);
104
105 void initialize_lambdas(FILE *fplog, t_inputrec *ir, int *fep_state, real *lambda, double *lam0);
106
107 void do_constrain_first(FILE *log, gmx_constr_t constr,
108                         t_inputrec *inputrec, t_mdatoms *md,
109                         t_state *state, t_commrec *cr, t_nrnb *nrnb,
110                         t_forcerec *fr, gmx_localtop_t *top);
111
112 void init_md(FILE *fplog,
113              t_commrec *cr, t_inputrec *ir, const output_env_t oenv,
114              double *t, double *t0,
115              real *lambda, int *fep_state, double *lam0,
116              t_nrnb *nrnb, gmx_mtop_t *mtop,
117              gmx_update_t *upd,
118              int nfile, const t_filenm fnm[],
119              gmx_mdoutf_t **outf, t_mdebin **mdebin,
120              tensor force_vir, tensor shake_vir,
121              rvec mu_tot,
122              gmx_bool *bSimAnn, t_vcm **vcm, unsigned long Flags);
123 /* Routine in sim_util.c */
124
125 #ifdef __cplusplus
126 }
127 #endif
128
129 #endif  /* _sim_util_h */