Merge release-4-6 into master
[alexxy/gromacs.git] / src / gromacs / gmxpreprocess / readir.h
1 /*
2  * 
3  *                This source code is part of
4  * 
5  *                 G   R   O   M   A   C   S
6  * 
7  *          GROningen MAchine for Chemical Simulations
8  * 
9  *                        VERSION 3.2.0
10  * Written by David van der Spoel, Erik Lindahl, Berk Hess, and others.
11  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
12  * Copyright (c) 2001-2004, The GROMACS development team,
13  * check out http://www.gromacs.org for more information.
14
15  * This program is free software; you can redistribute it and/or
16  * modify it under the terms of the GNU General Public License
17  * as published by the Free Software Foundation; either version 2
18  * of the License, or (at your option) any later version.
19  * 
20  * If you want to redistribute modifications, please consider that
21  * scientific software is very special. Version control is crucial -
22  * bugs must be traceable. We will be happy to consider code for
23  * inclusion in the official distribution, but derived work must not
24  * be called official GROMACS. Details are found in the README & COPYING
25  * files - if they are missing, get the official version at www.gromacs.org.
26  * 
27  * To help us fund GROMACS development, we humbly ask that you cite
28  * the papers on the package - you can find them in the top README file.
29  * 
30  * For more info, check our website at http://www.gromacs.org
31  * 
32  * And Hey:
33  * Gallium Rubidium Oxygen Manganese Argon Carbon Silicon
34  */
35
36 #ifndef _readir_h
37 #define _readir_h
38
39 #include "typedefs.h"
40 #include "string2.h"
41 #include "readinp.h"
42 #include "grompp.h"
43
44 enum { eshNONE, eshHBONDS, eshALLBONDS, eshHANGLES, eshALLANGLES, eshNR };
45
46 static const char *constraints[eshNR+1]    = { 
47   "none", "h-bonds", "all-bonds", "h-angles", "all-angles", NULL 
48 };
49
50 enum { ecouplamVDWQ, ecouplamVDW, ecouplamQ, ecouplamNONE, ecouplamNR };
51
52 static const char *couple_lam[ecouplamNR+1]    = { 
53   "vdw-q", "vdw", "q", "none", NULL 
54 };
55
56 typedef struct {
57   int warnings;
58   int nshake;
59   real fourierspacing;
60   char *include;
61   char *define;
62   gmx_bool bGenVel;
63   gmx_bool bGenPairs;
64   real tempi;
65   int  seed;
66   gmx_bool bOrire;
67   gmx_bool bDihre;
68   gmx_bool bMorse;
69   char *wall_atomtype[2];
70   gmx_bool pull_start;
71   char *couple_moltype;
72   int  couple_lam0;
73   int  couple_lam1;
74   gmx_bool bCoupleIntra;
75 } t_gromppopts;
76
77
78 extern void init_ir(t_inputrec *ir, t_gromppopts *opts);
79 /* Initiate stuff */
80
81 extern void check_ir(const char *mdparin,t_inputrec *ir, t_gromppopts *opts,
82                      warninp_t wi);
83 /* Validate inputrec data.
84  * Fatal errors will be added to nerror.
85  */
86 extern int search_string(char *s,int ng,char *gn[]);
87 /* Returns the index of string s in the index groups */
88
89 extern void double_check(t_inputrec *ir,matrix box,gmx_bool bConstr,
90                          warninp_t wi);
91 /* Do more checks */
92
93 extern void triple_check(const char *mdparin,t_inputrec *ir,gmx_mtop_t *sys,
94                          warninp_t wi);
95 /* Do even more checks */
96
97 extern void check_chargegroup_radii(const gmx_mtop_t *mtop,const t_inputrec *ir,
98                                     rvec *x,
99                                     warninp_t wi);
100 /* Even more checks, charge group radii vs. cut-off's only. */
101
102 extern void get_ir(const char *mdparin,const char *mdparout,
103                    t_inputrec *ir,t_gromppopts *opts,
104                    warninp_t wi);
105 /* Read the input file, and retrieve data for inputrec.
106  * More data are read, but the are only evaluated when the next
107  * function is called. Also prints the input file back to mdparout.
108  */
109  
110 extern void do_index(const char* mdparin, 
111                      const char *ndx,
112                      gmx_mtop_t *mtop,
113                      gmx_bool bVerbose,
114                      t_inputrec *ir,
115                      rvec *v,
116                      warninp_t wi);
117 /* Read the index file and assign grp numbers to atoms.
118  * If v is not NULL, the velocities will be scaled to the correct number
119  * of degrees of freedom.
120  */
121
122 /* Routines In readpull.c */
123
124 extern char **read_pullparams(int *ninp_p,t_inpfile **inp,
125                               t_pull *pull,gmx_bool *bStart,
126                               warninp_t wi);
127 /* Reads the pull parameters, returns a list of the pull group names */
128
129 extern void make_pull_groups(t_pull *pull,char **pgnames,
130                              t_blocka *grps,char **gnames);
131 /* Process the pull parameters after reading the index groups */
132
133 extern void set_pull_init(t_inputrec *ir,gmx_mtop_t *mtop,rvec *x,matrix box,
134                           const output_env_t oenv, gmx_bool bStart);
135 /* Prints the initial pull group distances in x.
136  * If bStart adds the distance to the initial reference location.
137  */
138
139 extern int str_nelem(const char *str,int maxptr,char *ptr[]);
140 /* helper function from readir.c to convert strings */
141
142 extern void read_adressparams(int *ninp_p,t_inpfile **inp_p,t_adress *adress, warninp_t wi);
143 /* Reads in AdResS related parameters */
144
145 extern void do_adress_index(t_adress *adress, gmx_groups_t *groups,char **gnames,t_grpopts *opts,warninp_t wi);
146 /* Generate adress groups */
147
148 extern char **read_rotparams(int *ninp_p,t_inpfile **inp,t_rot *rot,warninp_t wi);
149 /* Reads enforced rotation parameters, returns a list of the rot group names */
150
151 extern void make_rotation_groups(t_rot *rot,char **rotgnames,
152                  t_blocka *grps,char **gnames);
153 /* Process the rotation parameters after reading the index groups */
154
155 extern void set_reference_positions(t_rot *rot, gmx_mtop_t *mtop, rvec *x, matrix box,
156         const char *fn, gmx_bool bSet, warninp_t wi);
157
158 #endif  /* _readir_h */