dd89a1761233f461bc71e37c0a1d0893e2fa37bc
[alexxy/gromacs.git] / include / types / pulls.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 typedef enum {eStart, eAfm, eConstraint, eUmbrella, eTest} t_runtype;
35 typedef enum {eCom, eComT0, eDyn, eDynT0} t_reftype;
36
37 typedef struct {
38   int        n;         /* number of groups */
39   atom_id    **idx;     /* indices of pull atoms in full coordinate array */
40   real       **weights; /* position depended weight (switch function) */
41   int        *ngx;      /* pull group sizes */
42   char       **grps;    /* pull group names */
43   real       *tmass;    /* total mass of the groups */
44   rvec       **x0;      /* pull group coordinates at t=0 */
45   rvec       **xp;      /* pull group coordinates at previous step */
46   rvec       *x_ref;    /* reference positions */
47   rvec       *x_unc;    /* center of mass before constraining */
48   rvec       *x_con;    /* center of mass, obeying constraints */
49   rvec       *xprev;    /* position of coms in last written structure */
50   rvec       *f;        /* forces due to the pulling/constraining */
51   rvec       *spring;   /* coordinates of the springs (eAfm) */
52   rvec       *dir;      /* direction of constraint */
53   real       *d_ref;    /* reference distance  */
54   rvec       *xtarget;  /* target coordinates for structure generation */
55   rvec       **comhist; /* com over the last nhist steps (for running aver) */
56 } t_pullgrps; 
57
58 typedef struct {
59   t_pullgrps dyna;      /* dynamic groups for use with local constraints */
60   t_pullgrps pull;      /* groups to pull/restrain/etc/ */
61   t_pullgrps ref;       /* reference group, reaction force grps */
62   t_runtype  runtype;   /* start, afm, constraint, umbrella, test */
63   t_reftype  reftype;   /* com, com_t0, dynamic, dynamic_t0 */
64   rvec       dims;      /* used to select components for constraint */
65   rvec       coor;      /* reaction coordinate */
66   real       r;         /* radius of cylinder for dynamic COM */
67   real       rc;        /* radius of cylinder including switch length */
68   int        bRot[3];   /* rotation around x, y, z? */
69   real       rot_rate;  /* rate of rotation, for startstructure run */
70   real       xlt_rate;  /* rate of translation, for startstructure run */
71   int        rot_incr;  /* write out structure every rot_incr degrees */
72   real       xlt_incr;  /* write out structure every xlt_incr nm */
73   real       tolerance; /* tolerance for reaching desired coordinates (nm) */
74   real       constr_tol;/* absolute tolerance for constraints in (nm) */
75   bool       bPull;     /* true if we're doing any pulling */
76   bool       bCyl;      /* true if we're using dynamic ref. groups */
77   bool       bReverse;  /* reverse reference direction */
78   FILE       *out;      /* output file for pull data */
79   real       k;         /* force constant for atoms */
80   real       rate;      /* pull rate, in nm/timestep */
81   real       um_width;  /* width umbrella potential */  
82   int        update;    /* update frequency for dynamic grps */
83   int        reflag;    /* running average over reflag steps for com */
84   bool       bVerbose;  /* be loud and noise */
85 } t_pull;
86
87
88