4 * This source code is part of
8 * GROningen MAchine for Chemical Simulations
12 * Copyright (c) 1991-1999
13 * BIOSON Research Institute, Dept. of Biophysical Chemistry
14 * University of Groningen, The Netherlands
17 * GROMACS: A message-passing parallel molecular dynamics implementation
18 * H.J.C. Berendsen, D. van der Spoel and R. van Drunen
19 * Comp. Phys. Comm. 91, 43-56 (1995)
21 * Also check out our WWW page:
22 * http://md.chem.rug.nl/~gmx
27 * Green Red Orange Magenta Azure Cyan Skyblue
33 static char *SRCID_update_h = "$Id$";
40 #ident "@(#) update.h 1.33 24 Jun 1996"
41 #endif /* HAVE_IDENT */
50 extern void update(int natoms, /* number of atoms in simulation */
52 int homenr, /* number of home particles */
54 real lambda, /* FEP scaling parameter */
55 real *dvdlambda, /* FEP stuff */
56 t_parm *parm, /* input record and box stuff */
57 real SAfactor, /* simulated annealing factor */
59 rvec x[], /* coordinates of home particles */
61 rvec force[],/* forces on home particles */
63 rvec vold[], /* Old velocities */
64 rvec vt[], /* velocities at whole steps */
65 rvec v[], /* velocity at next halfstep */
78 extern void calc_ke_part(bool bFirstStep,bool bSD,int start,int homenr,
79 rvec vold[],rvec v[],rvec vt[],
80 t_grpopts *opts,t_mdatoms *md,
81 t_groups *grps,t_nrnb *nrnb,
82 real lambda,real *dvdlambda);
84 * Compute the partial kinetic energy for home particles;
85 * will be accumulated in the calling routine.
86 * The velocity a the whole step is obtained by averaging
87 * the velocities of minus and plus a half step,
88 * in case of Stochastic Dynamics a correction is applied.
91 * Ekin = SUM(i) 0.5 m[i] v[i] (x) v[i]
93 * use v[i] = v[i] - u[i] when calculating temperature
95 * u must be accumulated already.
97 * Now also computes the contribution of the kinetic energy to the
102 extern void calc_ke_part_visc(bool bFirstStep,int start,int homenr,
104 rvec vold[],rvec v[],rvec vt[],
105 t_grpopts *opts,t_mdatoms *md,
106 t_groups *grps,t_nrnb *nrnb,
107 real lambda,real *dvdlambda);
108 /* The same as calc_ke_part, but for viscosity calculations.
109 * The cosine velocity profile is excluded from the kinetic energy.
110 * The new amplitude of the velocity profile is calculated for this
111 * node and stored in grps->cosacc.mvcos.
114 extern void init_sd_consts(int ngtc,real tau_t[],real dt);
115 /* Initialization of the SD constants (obviously). */
117 /* Routines from coupling.c to do with Temperature, Pressure and coupling
120 extern real run_aver(real old,real cur,int step,int nmem);
122 extern void berendsen_tcoupl(t_grpopts *opts,t_groups *grps,
123 real dt,real SAfactor);
124 extern void nosehoover_tcoupl(t_grpopts *opts,t_groups *grps,
125 real dt,real SAfactor);
126 /* Compute temperature scaling. For Nose-Hoover it is done in update. */
128 extern real calc_temp(real ekin,real nrdf);
129 /* Calculate the temperature */
131 extern void calc_pres(int ePBC,matrix box,
132 tensor ekin,tensor vir,tensor pres,real Elr);
133 /* Calculate the pressure. Unit of pressure is bar, If Elr != 0
134 * a long range correction based on Ewald/PPPM is made (see c-code)
137 extern void parinellorahman_pcoupl(t_inputrec *ir,int step,tensor pres,
138 tensor box,tensor boxv,tensor M);
140 extern void berendsen_pcoupl(t_inputrec *ir,int step,tensor pres,
141 matrix box,int start,int nr_atoms,
142 rvec x[],unsigned short cFREEZE[],
143 t_nrnb *nrnb,ivec nFreeze[]);
145 extern void correct_box(tensor box);
147 extern void correct_ekin(FILE *log,int start,int end,rvec v[],
148 rvec vcm,real mass[],real tmass,tensor ekin);
149 /* Correct ekin for vcm */
151 #endif /* _update_h */