Tagged files with gromacs 3.0 header and added some license info
[alexxy/gromacs.git] / include / update.h
1 /*
2  * $Id$
3  * 
4  *                This source code is part of
5  * 
6  *                 G   R   O   M   A   C   S
7  * 
8  *          GROningen MAchine for Chemical Simulations
9  * 
10  *                        VERSION 3.0
11  * 
12  * Copyright (c) 1991-2001
13  * BIOSON Research Institute, Dept. of Biophysical Chemistry
14  * University of Groningen, The Netherlands
15  * 
16  * This program is free software; you can redistribute it and/or
17  * modify it under the terms of the GNU General Public License
18  * as published by the Free Software Foundation; either version 2
19  * of the License, or (at your option) any later version.
20  * 
21  * If you want to redistribute modifications, please consider that
22  * scientific software is very special. Version control is crucial -
23  * bugs must be traceable. We will be happy to consider code for
24  * inclusion in the official distribution, but derived work must not
25  * be called official GROMACS. Details are found in the README & COPYING
26  * files - if they are missing, get the official version at www.gromacs.org.
27  * 
28  * To help us fund GROMACS development, we humbly ask that you cite
29  * the papers on the package - you can find them in the top README file.
30  * 
31  * Do check out http://www.gromacs.org , or mail us at gromacs@gromacs.org .
32  * 
33  * And Hey:
34  * Good ROcking Metal Altar for Chronical Sinners
35  */
36
37 #ifndef _update_h
38 #define _update_h
39
40 static char *SRCID_update_h = "$Id$";
41 #ifdef HAVE_CONFIG_H
42 #include <config.h>
43 #endif
44
45 #ifdef HAVE_IDENT
46 #ident  "@(#) update.h 1.33 24 Jun 1996"
47 #endif /* HAVE_IDENT */
48
49 #include "typedefs.h"
50 #include "mshift.h"
51 #include "tgroup.h"
52 #include "network.h"
53 #include "force.h"
54 #include "pull.h"
55
56 extern void update(int          natoms, /* number of atoms in simulation */
57                    int          start,
58                    int          homenr, /* number of home particles     */
59                    int          step,
60                    real         lambda, /* FEP scaling parameter */
61                    real         *dvdlambda, /* FEP stuff */
62                    t_parm       *parm,    /* input record and box stuff */
63                    real         SAfactor, /* simulated annealing factor   */
64                    t_mdatoms    *md,
65                    rvec         x[],    /* coordinates of home particles */
66                    t_graph      *graph, 
67                    rvec         force[],/* forces on home particles     */
68                    rvec         delta_f[],
69                    rvec         vold[], /* Old velocities                  */
70                    rvec         vt[],   /* velocities at whole steps */
71                    rvec         v[],    /* velocity at next halfstep    */
72                    t_topology   *top,
73                    t_groups     *grps,
74                    tensor       vir_part,
75                    t_commrec    *cr,
76                    t_nrnb       *nrnb,
77                    bool         bTYZ,
78                    bool         bDoUpdate,
79                    t_edsamyn    *edyn,
80                    t_pull       *pulldata,
81                    bool         bConstrain,
82                    bool         bNEMD);
83      
84 extern void calc_ke_part(bool bFirstStep,bool bSD,int start,int homenr,
85                          rvec vold[],rvec v[],rvec vt[],
86                          t_grpopts *opts,t_mdatoms *md,
87                          t_groups *grps,t_nrnb *nrnb,
88                          real lambda,real *dvdlambda);
89 /*
90  * Compute the partial kinetic energy for home particles;
91  * will be accumulated in the calling routine.
92  * The velocity a the whole step is obtained by averaging
93  * the velocities of minus and plus a half step,
94  * in case of Stochastic Dynamics a correction is applied.
95  * The tensor is
96  *
97  * Ekin = SUM(i) 0.5 m[i] v[i] (x) v[i]
98  *    
99  *     use v[i] = v[i] - u[i] when calculating temperature
100  *
101  * u must be accumulated already.
102  *
103  * Now also computes the contribution of the kinetic energy to the
104  * free energy
105  *
106  */
107
108 extern void calc_ke_part_visc(bool bFirstStep,int start,int homenr,
109                               matrix box,rvec x[],
110                               rvec vold[],rvec v[],rvec vt[],
111                               t_grpopts *opts,t_mdatoms *md,
112                               t_groups *grps,t_nrnb *nrnb,
113                               real lambda,real *dvdlambda);
114 /* The same as calc_ke_part, but for viscosity calculations.
115  * The cosine velocity profile is excluded from the kinetic energy.
116  * The new amplitude of the velocity profile is calculated for this
117  * node and stored in grps->cosacc.mvcos.
118  */
119
120 extern void init_sd_consts(int ngtc,real tau_t[],real dt);
121 /* Initialization of the SD constants (obviously). */
122
123 /* Routines from coupling.c to do with Temperature, Pressure and coupling
124  * algorithms.
125  */
126 extern real run_aver(real old,real cur,int step,int nmem);
127
128 extern void berendsen_tcoupl(t_grpopts *opts,t_groups *grps,
129                              real dt,real SAfactor);
130 extern void nosehoover_tcoupl(t_grpopts *opts,t_groups *grps,
131                               real dt,real SAfactor);
132 /* Compute temperature scaling. For Nose-Hoover it is done in update. */
133
134 extern real calc_temp(real ekin,real nrdf);
135 /* Calculate the temperature */
136
137 extern void calc_pres(int ePBC,matrix box,
138                       tensor ekin,tensor vir,tensor pres,real Elr);
139 /* Calculate the pressure. Unit of pressure is bar, If Elr != 0
140  * a long range correction based on Ewald/PPPM is made (see c-code)
141  */
142
143 extern void parinellorahman_pcoupl(t_inputrec *ir,int step,tensor pres,
144                                    tensor box,tensor boxv,tensor M);
145   
146 extern void berendsen_pcoupl(t_inputrec *ir,int step,tensor pres,
147                              matrix box,int start,int nr_atoms,
148                              rvec x[],unsigned short cFREEZE[],
149                              t_nrnb *nrnb,ivec nFreeze[]);
150
151 extern void correct_box(tensor box);
152                       
153 extern void correct_ekin(FILE *log,int start,int end,rvec v[],
154                          rvec vcm,real mass[],real tmass,tensor ekin);
155 /* Correct ekin for vcm */
156
157 #endif  /* _update_h */
158