changed reading hint
[gromacs/adressmacs.git] / include / pull.h
blob3d3850b02a78055010e781e85b796e413fe44805
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
31 #ifndef _pull_h
32 #define _pull_h
34 static char *SRCID_pull_h = "$Id$";
36 #include "vec.h"
37 #include "typedefs.h"
39 #define NINT(x) (x<0?((int)((x)-0.5)):((int)((x)+0.5)))
40 #define DEBUG_START fprintf(stderr,"\n\nDEBUG\n");
41 #define DEBUG_END fprintf(stderr,"\nEND DEBUG\n\n");
43 /* print to output file for the various types of runs */
44 extern void print_umbrella(t_pull *pull, int step);
45 extern void print_afm(t_pull *pull, int step);
46 extern void print_constraint(t_pull *pull,rvec *force,int step,matrix box);
47 extern void print_start(t_pull *pull, int step);
50 /* calculate center of mass of index group, making sure it's inside the box.
51 function returns total mass.
53 extern real calc_com(rvec x[], /* coordinates of all atoms in system */
54 int gnx, /* size of index group */
55 atom_id *index, /* indices of atoms to be used for com */
56 t_mdatoms *md, /* all atoms */
57 rvec com, /* calculated center of mass */
58 matrix box);
61 /* calculate center of mass of all atoms x[], index needed to get the right
62 masses from the atom array. function returns total mass.*/
63 extern real calc_com2(rvec x[], /* coordinates to calc. com from */
64 int gnx, /* nr. of atom in group */
65 atom_id *index, /* indices of x[] in all atoms */
66 t_mdatoms *md, /* all atoms */
67 rvec com, /* calculated center of mass */
68 matrix box);
71 /* calculate a running average for center of mass */
72 extern void calc_running_com(t_pull *pull);
75 /* calculate the center of mass from the true coordinates, without
76 corrections for pbc */
77 extern void correct_t0_pbc(t_pull *pull,
78 rvec x[],
79 t_mdatoms *md,
80 matrix box);
83 /* parse a string for 3 numbers and put them in rvec */
84 extern void string2rvec(char *buf,
85 rvec x);
87 /* read the parameter file .ppa and write out what was read in */
88 extern void read_pullparams(t_pull *pull,
89 char *infile,
90 char *outfile);
92 /* find all atoms in group pull->idx[pull->n] that are inside a cylinder
93 with as origin com[i][x],com[i][y] with radius pull->r and possibly
94 a switch function pull->rc. Remember their weight. Now each group i
95 has its own reference group (HOW?) with com defined as
96 Sum(wi*mi*ri)/(Sum(wi*mi). Basically, build an index structure with
97 the reference groups for the groups i, plus an array with the
98 weight factors for each of the atoms in those index groups?
100 extern void make_refgrps(t_pull *pull,
101 matrix box,
102 t_mdatoms *md);
105 /* write a numbered .gro file in procedure to make starting structures */
106 extern void dump_conf(t_pull *pull,
107 rvec x[], /* all coordinates */
108 matrix box, /* box */
109 t_topology *top, /* names and residue info */
110 int nout, /* sequence number of this file */
111 real time); /* time in simulation */
114 /* main pull routine that controls all the action */
115 extern void pull(t_pull *pull, /* all pull data */
116 rvec *x, /* coordinates, changed by constraint run */
117 rvec *f, /* forces, changed by Afm run */
118 matrix box,
119 t_topology *top, /* needed to write out coordinate files */
120 real dt, /* time step */
121 int step, /* step number in simulation */
122 int natoms, /* total number of atoms on this processor */
123 t_mdatoms *md); /* masses and charges of all atoms */
126 /* get memory and initialize the fields of pull that still need it, and
127 do runtype specific initialization */
128 extern void init_pull(FILE *log,
129 int nfile,
130 t_filenm fnm[], /* standard filename struct */
131 t_pull *pull, /* all pull data */
132 rvec *x, /* all coordinates */
133 t_mdatoms *md, /* masses and charges of all atoms */
134 rvec boxsize);
136 #endif