290fb8f368b5e037c8e1867c3e4e1eb35dc04650
[alexxy/gromacs.git] / include / random.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 2.0
11  * 
12  * Copyright (c) 1991-1999
13  * BIOSON Research Institute, Dept. of Biophysical Chemistry
14  * University of Groningen, The Netherlands
15  * 
16  * Please refer to:
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)
20  * 
21  * Also check out our WWW page:
22  * http://md.chem.rug.nl/~gmx
23  * or e-mail to:
24  * gromacs@chem.rug.nl
25  * 
26  * And Hey:
27  * Green Red Orange Magenta Azure Cyan Skyblue
28  */
29
30 #ifndef _random_h
31 #define _random_h
32
33 static char *SRCID_random_h = "$Id$";
34
35 #ifdef HAVE_CONFIG_H
36 #include <config.h>
37 #endif
38
39 #ifdef HAVE_IDENT
40 #ident  "@(#) random.h 1.5 12/16/92"
41 #endif /* HAVE_IDENT */
42
43 #include <typedefs.h>
44
45 extern real gauss(real am, real sd, int *ig);
46 /* Generate a gaussian number with:
47  * am = center of the distribution
48  * sd = standard deviation
49  * ig = the random number seed.
50  */
51
52 extern int make_seed(void);
53 /* Make a random seed: (time+getpid) % 1000000 */
54
55 extern real rando(int *ig);
56 /* Generate a random number 0 <= r < 1. ig is the (address of) the
57  * seed variable.
58  */
59
60 extern void grp_maxwell(t_block *grp,real tempi[],int nrdf[],int seed,
61                         t_atoms *atoms,rvec v[]);
62 /* Generate for each group in grp a temperature.
63  * When seed = -1, set the seed to make_seed.
64  */
65
66 extern void maxwell_speed(real tempi,int nrdf,int seed, 
67                           t_atoms *atoms, rvec v[]);
68 /* Generate velocites according to a maxwellian distribution */
69
70 extern real calc_cm(FILE *log,int natoms,real mass[],rvec x[],rvec v[],
71                     rvec xcm,rvec vcm,rvec acm,matrix L);
72 /* Calculate the c.o.m. position, velocity, acceleration and the
73  * moment of Inertia. Returns the total mass.
74  */
75
76 extern void stop_cm(FILE *log,int natoms,real mass[],rvec x[],rvec v[]);
77
78 #endif  /* _random_h */