2 * This file is part of the GROMACS molecular simulation package.
4 * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
5 * Copyright (c) 2001-2004, The GROMACS development team.
6 * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
7 * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
8 * and including many others, as listed in the AUTHORS file in the
9 * top-level source directory and at http://www.gromacs.org.
11 * GROMACS is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU Lesser General Public License
13 * as published by the Free Software Foundation; either version 2.1
14 * of the License, or (at your option) any later version.
16 * GROMACS is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * Lesser General Public License for more details.
21 * You should have received a copy of the GNU Lesser General Public
22 * License along with GROMACS; if not, see
23 * http://www.gnu.org/licenses, or write to the Free Software Foundation,
24 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
26 * If you want to redistribute modifications to GROMACS, please
27 * consider that scientific software is very special. Version
28 * control is crucial - bugs must be traceable. We will be happy to
29 * consider code for inclusion in the official distribution, but
30 * derived work must not be called official GROMACS. Details are found
31 * in the README & COPYING files - if they are missing, get the
32 * official version at http://www.gromacs.org.
34 * To help us fund GROMACS development, we humbly ask that you cite
35 * the research papers on the package. Check out http://www.gromacs.org.
38 #ifndef GMX_GMXPREPROCESS_READIR_H
39 #define GMX_GMXPREPROCESS_READIR_H
41 #include "gromacs/fileio/readinp.h"
42 #include "gromacs/gmxpreprocess/grompp-impl.h"
46 struct gmx_output_env_t;
54 eshNONE, eshHBONDS, eshALLBONDS, eshHANGLES, eshALLANGLES, eshNR
58 ecouplamVDWQ, ecouplamVDW, ecouplamQ, ecouplamNONE, ecouplamNR
72 char *wall_atomtype[2];
76 gmx_bool bCoupleIntra;
79 /*! \brief Initialise object to hold strings parsed from an .mdp file */
80 void init_inputrec_strings();
82 /*! \brief Clean up object that holds strings parsed from an .mdp file */
83 void done_inputrec_strings();
85 void init_ir(t_inputrec *ir, t_gromppopts *opts);
88 void check_ir(const char *mdparin, t_inputrec *ir, t_gromppopts *opts,
90 /* Validate inputrec data.
91 * Fatal errors will be added to nerror.
93 int search_string(const char *s, int ng, char *gn[]);
94 /* Returns the index of string s in the index groups */
96 void double_check(t_inputrec *ir, matrix box,
97 gmx_bool bHasNormalConstraints,
98 gmx_bool bHasAnyConstraints,
102 void triple_check(const char *mdparin, t_inputrec *ir, gmx_mtop_t *sys,
104 /* Do even more checks */
106 void check_chargegroup_radii(const gmx_mtop_t *mtop, const t_inputrec *ir,
109 /* Even more checks, charge group radii vs. cut-off's only. */
111 void get_ir(const char *mdparin, const char *mdparout,
112 t_inputrec *ir, t_gromppopts *opts,
114 /* Read the input file, and retrieve data for inputrec.
115 * More data are read, but the are only evaluated when the next
116 * function is called. Also prints the input file back to mdparout.
119 void do_index(const char* mdparin,
125 /* Read the index file and assign grp numbers to atoms.
128 /* Routines In readpull.c */
130 char **read_pullparams(int *ninp_p, t_inpfile **inp,
133 /* Reads the pull parameters, returns a list of the pull group names */
135 void make_pull_groups(pull_params_t *pull,
137 const t_blocka *grps, char **gnames);
138 /* Process the pull group parameters after reading the index groups */
140 void make_pull_coords(pull_params_t *pull);
141 /* Process the pull coordinates after reading the pull groups */
143 pull_t *set_pull_init(t_inputrec *ir, const gmx_mtop_t *mtop,
144 rvec *x, matrix box, real lambda,
145 const gmx_output_env_t *oenv);
146 /* Prints the initial pull group distances in x.
147 * If requested, adds the current distance to the initial reference location.
148 * Returns the pull_t pull work struct. This should be passed to finish_pull()
149 * after all modules have registered their external potentials, if present.
152 int str_nelem(const char *str, int maxptr, char *ptr[]);
153 /* helper function from readir.c to convert strings */
155 char **read_rotparams(int *ninp_p, t_inpfile **inp, t_rot *rot, warninp_t wi);
156 /* Reads enforced rotation parameters, returns a list of the rot group names */
158 void make_rotation_groups(t_rot *rot, char **rotgnames,
159 t_blocka *grps, char **gnames);
160 /* Process the rotation parameters after reading the index groups */
162 void set_reference_positions(t_rot *rot, rvec *x, matrix box,
163 const char *fn, gmx_bool bSet, warninp_t wi);