changed reading hint
[gromacs/adressmacs.git] / include / pbc.h
blob294d34aea1055f94eb455389e1e9ef9152322f84
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
12 * Copyright (c) 1991-1999
13 * BIOSON Research Institute, Dept. of Biophysical Chemistry
14 * University of Groningen, The Netherlands
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)
21 * Also check out our WWW page:
22 * http://md.chem.rug.nl/~gmx
23 * or e-mail to:
24 * gromacs@chem.rug.nl
26 * And Hey:
27 * Good ROcking Metal Altar for Chronical Sinners
30 #ifndef _pbc_h
31 #define _pbc_h
33 static char *SRCID_pbc_h = "$Id$";
35 #ifdef HAVE_IDENT
36 #ident "@(#) pbc.h 1.17 2/2/97"
37 #endif /* HAVE_IDENT */
38 #include "sysstuff.h"
39 #include "typedefs.h"
41 #ifdef CPLUSPLUS
42 extern "C" {
43 #endif
45 extern void init_pbc(matrix box,bool bTruncOct);
46 /* Initiate the periodic boundary conditions. Set bTruncOct to
47 * TRUE when using a truncated octahedron box.
50 extern void pbc_dx(rvec x1, rvec x2, rvec dx);
51 /* Calculate the correct distance vector from x1 and x2 and put it in
52 * dx. init_pbc must be called before ever calling this routine
53 * (this is done by put_charge_groups_in_box).
56 extern bool image_rect(ivec xi,ivec xj,ivec box_size,
57 real rlong2,int *shift,real *r2);
58 /* Calculate the distance between xi and xj for a rectangular box.
59 * When the distance is SMALLER than rlong2 return TRUE, return
60 * the shift code in shift and the distance in r2. When the distance is
61 * >= rlong2 return FALSE;
62 * It is assumed that rlong2 is scaled the same way as the ivecs xi and xj.
65 extern bool image_tri(ivec xi,ivec xj,imatrix box,
66 real rlong2,int *shift,real *r2);
67 /* Calculate the distance between xi and xj for a triclinic box.
68 * When the distance is SMALLER than rlong2 return TRUE, return
69 * the shift code in shift and the distance in r2. When the distance is
70 * >= rlong2 return FALSE;
71 * It is assumed that rlong2 is scaled the same way as the ivecs xi and xj.
74 extern bool image_cylindric(ivec xi,ivec xj,ivec box_size,real rlong2,
75 int *shift,real *r2);
76 /* Calculate the distance between xi and xj for a rectangular box
77 * using a cylindric cutoff for long-range only.
78 * When the distance is SMALLER than rlong2 (in X and Y dir.)
79 * return TRUE, return
80 * the shift code in shift and the distance in r2. When the distance is
81 * >= rlong2 return FALSE;
82 * It is assumed that rlong2 is scaled the same way as the ivecs xi and xj.
85 extern void calc_shifts(matrix box,rvec box_size,rvec shift_vec[],
86 bool bTruncOct);
87 /* This routine calculates ths shift vectors necessary to use the
88 * ns routine. Note that for the truncated octahedron case too many
89 * shift vectors can be calculated: The ones for which exactly
90 * 2 of the k,l,m indexes are not 0 (12 vectors lying along the box
91 * edges. This can be compensated for by removing all the shift_vecs with
92 * (k+l+m) even. This is a feature of the way in which the counting is
93 * done. It implies that, when using truncated octahedron,
94 * the shift codes 1,3,5,7,9,11,15,17,19,21,23,25 should never occur,
95 * that is, every second entry, EXCEPT the central box.
98 extern void calc_cgcm(FILE *log,int cg0,int cg1,t_block *cgs,
99 rvec pos[],rvec cg_cm[]);
100 /* Routine to compute centers of geometry of charge groups. No periodicity
101 * is used.
104 extern void put_charge_groups_in_box (FILE *log,int cg0,int cg1,bool bTruncOct,
105 matrix box,rvec box_size,t_block *cgs,
106 rvec pos[],rvec shift_vec[],
107 rvec cg_cm[]);
109 /* This routine puts charge groups in the periodic box, keeping them
110 * together. When bTruncOct==TRUE a truncated octahedron
111 * box is used. There are no checks: the first element of the box matrix
112 * is taken to be the box edge.
115 extern void put_atoms_in_box(int natoms,matrix box,rvec x[]);
116 /* This puts ALL atoms in the box, not caring about charge gorups! */
118 #ifdef CPLUSPLUS
120 #endif
122 #endif /* _pbc_h */