Upped the version to 3.2.0
[gromacs.git] / include / pull.h
blob940e8cebc9d2584e2bdb35d2509569cdc33f0ef7
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 3.2.0
11 * Written by David van der Spoel, Erik Lindahl, Berk Hess, and others.
12 * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
13 * Copyright (c) 2001-2004, The GROMACS development team,
14 * check out http://www.gromacs.org for more information.
16 * This program is free software; you can redistribute it and/or
17 * modify it under the terms of the GNU General Public License
18 * as published by the Free Software Foundation; either version 2
19 * of the License, or (at your option) any later version.
21 * If you want to redistribute modifications, please consider that
22 * scientific software is very special. Version control is crucial -
23 * bugs must be traceable. We will be happy to consider code for
24 * inclusion in the official distribution, but derived work must not
25 * be called official GROMACS. Details are found in the README & COPYING
26 * files - if they are missing, get the official version at www.gromacs.org.
28 * To help us fund GROMACS development, we humbly ask that you cite
29 * the papers on the package - you can find them in the top README file.
31 * For more info, check our website at http://www.gromacs.org
33 * And Hey:
34 * Gromacs Runs On Most of All Computer Systems
37 #ifndef _pull_h
38 #define _pull_h
40 #ifdef HAVE_CONFIG_H
41 #include <config.h>
42 #endif
44 #include "vec.h"
45 #include "typedefs.h"
47 /* This file contains datatypes and function declarations necessary
48 for mdrun to interface with the pull code */
50 typedef enum {
51 eAfm, eConstraint, eUmbrella, ePullruntypeNR
52 } t_pullruntype;
53 typedef enum {
54 eCom, eComT0, eDyn, eDynT0
55 } t_pullreftype;
57 typedef struct {
58 atom_id *idx; /* indices of pull atoms in full coordinate array */
59 int nweight; /* The number of weights read from the param file */
60 real *weight; /* weights (use all 1 when nweight==0) */
61 int ngx; /* pull group size */
62 char *name; /* pull group name */
63 real wscale; /* scaling factor for the weights: sum w m/sum w w m */
64 real tmass; /* total mass of the group: wscale sum w m */
65 rvec *x0; /* pull group coordinates at t=0 */
66 rvec *xp; /* pull group coordinates at previous step */
67 dvec x_ref; /* reference position */
68 dvec x_unc; /* center of mass before constraining */
69 dvec x_con; /* center of mass, obeying constraints */
70 dvec xprev; /* position of coms in last written structure */
71 dvec f; /* force due to the pulling/constraining */
72 dvec spring; /* coordinates of the spring (eAfm) */
73 dvec dir; /* direction of constraint */
74 dvec xtarget; /* target coordinates for structure generation */
75 dvec *comhist; /* com over the last nhist steps (for running aver) */
76 dvec AfmVec; /* Vector to pull along for AFM */
77 real AfmK; /* Force constant to use for AFM */
78 real AfmRate; /* Pull rate in nm/ps */
79 dvec AfmInit; /* Initial sprint posistions for AFM */
80 dvec UmbPos; /* center of umbrella potential */
81 real UmbCons; /* force constant of umbrella potential */
82 } t_pullgrp;
84 typedef struct {
85 t_pullgrp ref; /* reference group, reaction force grps */
86 int ngrp; /* number of groups */
87 t_pullgrp *grp; /* groups to pull/restrain/etc/ */
88 t_pullgrp *dyna; /* dynamic groups for use with local constraints */
89 t_pullruntype runtype; /* start, afm, constraint, umbrella, test */
90 t_pullreftype reftype; /* com, com_t0, dynamic, dynamic_t0 */
91 ivec dims; /* used to select components for constraint */
92 int bDir; /* use only the direction dir */
93 dvec dir; /* direction */
94 real r; /* radius of cylinder for dynamic COM */
95 real rc; /* radius of cylinder including switch length */
96 real constr_rate; /* rate of change of the constraint length (nm/ps) */
97 real constr_tol; /* absolute tolerance for constraints in (nm) */
98 bool bPull; /* true if we're doing any pulling */
99 bool bCyl; /* true if we're using dynamic ref. groups */
100 FILE *out; /* output file for pull data */
101 int update; /* update frequency for dynamic grps */
102 int reflag; /* running average over reflag steps for com */
103 bool AbsoluteRef; /* Reference is in absolute coordinates */
104 bool bVerbose; /* be loud and noise */
105 int nSkip; /* only write output every nSkip steps */
106 } t_pull;
108 /* main pull routine that controls all the action */
109 extern void pull(t_pull *pull, /* all pull data */
110 rvec *x, /* coordinates, changed by constraint run */
111 rvec *f, /* forces, changed by Afm run */
112 matrix box,
113 t_topology *top, /* needed to write out coordinate files */
114 real dt, /* time step */
115 int step, /* step number in simulation */
116 int natoms, /* total number of atoms on this processor */
117 t_mdatoms *md, /* masses and charges of all atoms */
118 int start, /* number of first atom belonging to this node */
119 int homenr, /* number of atoms that belong to this node */
120 t_commrec * cr /* Stuff for communication */
124 /* get memory and initialize the fields of pull that still need it, and
125 do runtype specific initialization */
126 extern void init_pull(FILE *log,
127 int nfile,
128 t_filenm fnm[], /* standard filename struct */
129 t_pull *pull, /* all pull data */
130 rvec *x, /* all coordinates */
131 t_mdatoms *md, /* masses and charges of all atoms */
132 matrix box,
133 int start, /* startinig index of this node */
134 int homenr, /* number of atoms on this node */
135 t_commrec * cr /* struct for communication info */
137 #endif