155b6a8bcc0545098051adea203f07e79acaec01
[alexxy/gromacs.git] / include / princ.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  * Good ROcking Metal Altar for Chronical Sinners
28  */
29
30 #ifndef _princ_h
31 #define _princ_h
32
33 static char *SRCID_princ_h = "$Id$";
34
35 #ifdef HAVE_CONFIG_H
36 #include <config.h>
37 #endif
38
39 #include "typedefs.h"
40
41 extern void rotate_atoms(int gnx,atom_id index[],rvec x[],matrix trans);
42 /* Rotate all atoms in index using matrix trans */
43
44 extern void principal_comp(int n,atom_id index[],t_atom atom[],rvec x[],
45                            matrix trans,rvec d);
46 /* Calculate the principal components of atoms in index. Atoms are
47  * mass weighted. It is assumed that the center of mass is in the origin!
48  */
49
50 extern void orient_princ(t_atoms *atoms, int isize, atom_id *index,
51                          int natoms, rvec x[], rvec *v, rvec *d);
52 /* rotates molecule to align principal axes with coordinate axes */
53
54 extern real calc_xcm(rvec x[],int gnx,atom_id *index,t_atom *atom,rvec xcm,
55                      bool bQ);
56 /* Calculate the center of mass of the atoms in index. if bQ then the atoms
57  * will be charge weighted rather than mass weighted.
58  * Returns the total mass/charge.
59  */
60
61 extern real sub_xcm(rvec x[],int gnx,atom_id *index,t_atom atom[],rvec xcm,
62                     bool bQ);
63 /* Calc. the center of mass and subtract it from all coordinates.
64  * Returns the original center of mass in xcm
65  * Returns the total mass
66  */
67
68 extern void add_xcm(rvec x[],int gnx,atom_id *index,rvec xcm);
69 /* Increment all atoms in index with xcm */
70
71 #endif