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