63b67b3cba9cd92b028732744aa3459cf6bdd6e7
[alexxy/gromacs.git] / include / vcm.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 _vcm_h
31 #define _vcm_h
32
33 static char *SRCID_vcm_h = "$Id$";
34
35 #ifdef HAVE_CONFIG_H
36 #include <config.h>
37 #endif
38
39 #ifdef HAVE_IDENT
40 #ident  "@(#) vcm.h 1.9 9/29/97"
41 #endif /* HAVE_IDENT */
42 #include "sysstuff.h"
43 #include "typedefs.h"
44
45 typedef struct {
46   int  nr;
47   rvec *group_mvcm;
48   real *group_mass;
49   char **group_name;         /* These two are copies to pointers in */
50   unsigned short *group_id;  /* other structures.                   */
51 } t_vcm;
52
53 t_vcm *init_vcm(FILE *fp,t_topology *top,t_mdatoms *md,
54                 int start,int homenr,int nstcomm);
55
56 extern void calc_vcm(FILE *log,int homenr,int start,
57                      real mass[],rvec v[],rvec vcm);
58
59 extern void do_stopcm(FILE *log,int homenr,int start,
60                       rvec v[],rvec mvcm,real tm,real invmass[]);
61
62 extern void check_cm(FILE *log,rvec mvcm,real tm);
63
64 /* remove global rotation of system by fitting to structure of nstcomm
65    steps ago */
66 extern void do_stoprot(FILE *log, int natoms, rvec box, rvec x[], 
67                        real mass[]);
68
69 /* Do a per group center of mass things */
70 extern void calc_vcm_grp(FILE *log,int homenr,int start,real mass[],rvec v[],
71                          t_vcm *vcm);
72
73 extern void do_stopcm_grp(FILE *log,int homenr,int start,rvec v[],
74                           t_vcm *vcm,real invmass[]);
75
76 extern void check_cm_grp(FILE *log,t_vcm *vcm);
77                          
78 #endif /* _vcm_h */