ef422d4dff3131415cd4a34cf75256e174b6c318
[alexxy/gromacs.git] / include / dummies.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 _dummies_h
31 #define _dummies_h
32
33 static char *SRCID_dummies_h = "$Id$";
34
35 #ifdef HAVE_CONFIG_H
36 #include <config.h>
37 #endif
38
39 #include <stdio.h>
40 #include "typedefs.h"
41
42 typedef struct {
43   int nprevdum; /* how many dummy particles are nonlocal */     
44   int nnextdum;
45   int *idxprevdum; /* index of nonlocal dummy particles */
46   int *idxnextdum;
47   int nprevconstr; /* how many constr. atoms are nonlocal */
48   int nnextconstr;
49   int *idxprevconstr; /* indices of nonlocal constructing atoms */
50   int *idxnextconstr;
51 } t_comm_dummies;
52
53 /* Communication routines for dummies. The coordinates and
54  * forces are only move on a need-to-know basis, usually only
55  * 2-3 atoms per processor. To achieve this small amount of
56  * communication, and to limit it to nearest neighbour messages,
57  * we demand that dummies are not spread over nonadjacent nodes.
58  * Thus, keep your dummies close to your constructing atoms.
59  * (mdrun & grompp will report an error otherwise)
60  */ 
61
62 extern void move_construct_x(t_comm_dummies *dummycomm,rvec x[],t_commrec *cr); 
63 /* Move coords of nonlocal constructing atoms */
64
65 extern void move_dummy_xv(t_comm_dummies *dummycomm,rvec x[],rvec v[],t_commrec *cr);
66 /* Send the coordinates and velocity of a constructed dummy to the home node */
67
68 extern void move_dummy_f(t_comm_dummies *dummycomm,rvec f[],t_commrec *cr);
69 /* Get dummy forces from the home node */
70
71 extern void move_construct_f(t_comm_dummies *dummycomm,rvec f[],t_commrec *cr);
72 /* Send spreaded forces to nonlocal constructing atoms */
73
74
75 extern void construct_dummies(FILE *log,rvec x[],t_nrnb *nrnb,
76                               real dt,rvec v[],t_idef *idef);
77 /* Create positions of dummy atoms based on surrounding atoms.
78  */
79  
80 extern void spread_dummy_f(FILE *log,rvec x[],rvec f[],rvec buf[],
81                            t_nrnb *nrnb,t_idef *idef);
82 /* Spread the force operating on the dummy atoms on the surrounding atoms.
83  */
84
85 #endif
86