4 * This source code is part of
8 * GROningen MAchine for Chemical Simulations
12 * Copyright (c) 1991-1999
13 * BIOSON Research Institute, Dept. of Biophysical Chemistry
14 * University of Groningen, The Netherlands
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
27 * Good ROcking Metal Altar for Chronical Sinners
34 static char *SRCID_pull_h = "$Id$";
43 #define NINT(x) (x<0?((int)((x)-0.5)):((int)((x)+0.5)))
44 #define DEBUG_START fprintf(stderr,"\n\nDEBUG\n");
45 #define DEBUG_END fprintf(stderr,"\nEND DEBUG\n\n");
47 /* print to output file for the various types of runs */
48 extern void print_umbrella(t_pull *pull, int step);
49 extern void print_afm(t_pull *pull, int step);
50 extern void print_constraint(t_pull *pull,rvec *force,int step,matrix box,
52 extern void print_start(t_pull *pull, int step);
55 /* calculate center of mass of index group, making sure it's inside the box.
56 function returns total mass.
58 extern real calc_com(rvec x[], /* coordinates of all atoms in system */
59 int gnx, /* size of index group */
60 atom_id *index, /* indices of atoms to be used for com */
61 t_mdatoms *md, /* all atoms */
62 rvec com, /* calculated center of mass */
66 /* calculate center of mass of all atoms x[], index needed to get the right
67 masses from the atom array. function returns total mass.*/
68 extern real calc_com2(rvec x[], /* coordinates to calc. com from */
69 int gnx, /* nr. of atom in group */
70 atom_id *index, /* indices of x[] in all atoms */
71 t_mdatoms *md, /* all atoms */
72 rvec com, /* calculated center of mass */
76 /* calculate a running average for center of mass */
77 extern void calc_running_com(t_pull *pull);
80 /* calculate the center of mass from the true coordinates, without
81 corrections for pbc */
82 extern void correct_t0_pbc(t_pull *pull,
88 /* parse a string for 3 numbers and put them in rvec */
89 extern void string2rvec(char *buf,
92 /* read the parameter file .ppa and write out what was read in */
93 extern void read_pullparams(t_pull *pull,
97 /* find all atoms in group pull->idx[pull->n] that are inside a cylinder
98 with as origin com[i][x],com[i][y] with radius pull->r and possibly
99 a switch function pull->rc. Remember their weight. Now each group i
100 has its own reference group (HOW?) with com defined as
101 Sum(wi*mi*ri)/(Sum(wi*mi). Basically, build an index structure with
102 the reference groups for the groups i, plus an array with the
103 weight factors for each of the atoms in those index groups?
105 extern void make_refgrps(t_pull *pull,
110 /* write a numbered .gro file in procedure to make starting structures */
111 extern void dump_conf(t_pull *pull,
112 rvec x[], /* all coordinates */
113 matrix box, /* box */
114 t_topology *top, /* names and residue info */
115 int nout, /* sequence number of this file */
116 real time); /* time in simulation */
119 /* main pull routine that controls all the action */
120 extern void pull(t_pull *pull, /* all pull data */
121 rvec *x, /* coordinates, changed by constraint run */
122 rvec *f, /* forces, changed by Afm run */
124 t_topology *top, /* needed to write out coordinate files */
125 real dt, /* time step */
126 int step, /* step number in simulation */
127 int natoms, /* total number of atoms on this processor */
128 t_mdatoms *md); /* masses and charges of all atoms */
131 /* get memory and initialize the fields of pull that still need it, and
132 do runtype specific initialization */
133 extern void init_pull(FILE *log,
135 t_filenm fnm[], /* standard filename struct */
136 t_pull *pull, /* all pull data */
137 rvec *x, /* all coordinates */
138 t_mdatoms *md, /* masses and charges of all atoms */