6c1f96fbdf348ded45b98568e2070d645e518735
[alexxy/gromacs.git] / include / types / ishift.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 #ifdef HAVE_CONFIG_H
31 #include <config.h>
32 #endif
33
34 #define D_BOX_Z 1
35 #ifdef ALLOW_OFFDIAG_LT_HALFDIAG
36 #define D_BOX_Y 2
37 #define D_BOX_X 2
38 #else
39 #define D_BOX_Y 1
40 #define D_BOX_X 1
41 #endif 
42 #define N_BOX_Z (2*D_BOX_Z+1)
43 #define N_BOX_Y (2*D_BOX_Y+1)
44 #define N_BOX_X (2*D_BOX_X+1)
45 #define N_IVEC  (N_BOX_Z*N_BOX_Y*N_BOX_X)
46 #define CENTRAL (N_IVEC/2)
47 #define SHIFTS  N_IVEC
48
49 #define XYZ2IS(x,y,z) (N_BOX_X*(N_BOX_Y*((z)+D_BOX_Z)+(y)+D_BOX_Y)+(x)+D_BOX_X)
50 #define IVEC2IS(iv)   (XYZ2IS((iv)[XX],(iv)[YY],(iv)[ZZ]))