4 * This source code is part of
8 * GROningen MAchine for Chemical Simulations
12 * Copyright (c) 1991-2001
13 * BIOSON Research Institute, Dept. of Biophysical Chemistry
14 * University of Groningen, The Netherlands
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.
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.
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.
31 * Do check out http://www.gromacs.org , or mail us at gromacs@gromacs.org .
34 * Good ROcking Metal Altar for Chronical Sinners
40 static char *SRCID_update_h = "$Id$";
46 #ident "@(#) update.h 1.33 24 Jun 1996"
47 #endif /* HAVE_IDENT */
56 extern void update(int natoms, /* number of atoms in simulation */
58 int homenr, /* number of home particles */
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 */
65 rvec x[], /* coordinates of home particles */
67 rvec force[],/* forces on home particles */
69 rvec vold[], /* Old velocities */
70 rvec vt[], /* velocities at whole steps */
71 rvec v[], /* velocity at next halfstep */
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);
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.
97 * Ekin = SUM(i) 0.5 m[i] v[i] (x) v[i]
99 * use v[i] = v[i] - u[i] when calculating temperature
101 * u must be accumulated already.
103 * Now also computes the contribution of the kinetic energy to the
108 extern void calc_ke_part_visc(bool bFirstStep,int start,int homenr,
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.
120 extern void init_sd_consts(int ngtc,real tau_t[],real dt);
121 /* Initialization of the SD constants (obviously). */
123 /* Routines from coupling.c to do with Temperature, Pressure and coupling
126 extern real run_aver(real old,real cur,int step,int nmem);
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. */
134 extern real calc_temp(real ekin,real nrdf);
135 /* Calculate the temperature */
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)
143 extern void parinellorahman_pcoupl(t_inputrec *ir,int step,tensor pres,
144 tensor box,tensor boxv,tensor M);
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[]);
151 extern void correct_box(tensor box);
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 */
157 #endif /* _update_h */