ad06edf71c636ca7cdb4a6d1d6aef7f9057aee04
[alexxy/gromacs.git] / src / gromacs / legacyheaders / grompp.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  * Gromacs Runs On Most of All Computer Systems
34  */
35
36 #ifndef _grompp_h
37 #define _grompp_h
38
39 #include <stdio.h>
40 #include "typedefs.h"
41
42 #ifdef __cplusplus
43 extern "C" {
44 #endif
45
46 #define MAXSLEN 32
47
48 typedef struct {
49     gmx_bool bSet;              /* Has this combination been set        */
50     real     c[4];              /* The non-bonded parameters            */
51 } t_nbparam;
52 /* The t_nbparam struct is used to temporary store the explicit
53  * non-bonded parameter combinations, which will be copied to t_params.
54  */
55
56 typedef struct {
57     atom_id    a[MAXATOMLIST];   /* The atom list (eg. bonds: particle  */
58     /* i = a[0] (AI), j = a[1] (AJ))    */
59     real       c[MAXFORCEPARAM]; /* Force parameters (eg. b0 = c[0])    */
60     char       s[MAXSLEN];       /* A string (instead of parameters),    *
61                                   * read from the .rtp file in pdb2gmx   */
62 } t_param;
63
64 typedef struct {
65     int          nr;    /* The number of bonds in this record   */
66     int          maxnr; /* The amount of elements in the array  */
67     t_param     *param; /* Array of parameters (dim: nr)        */
68
69     /* CMAP tmp data, there are probably better places for this */
70     int         grid_spacing; /* Cmap grid spacing */
71     int         nc;           /* Number of cmap angles */
72
73     real       *cmap;         /* Temporary storage of the raw cmap grid data */
74     int         ncmap;        /* Number of allocated elements in cmap grid*/
75
76     int        *cmap_types;   /* Store the five atomtypes followed by a number that identifies the type */
77     int         nct;          /* Number of allocated elements in cmap_types */
78
79 } t_params;
80
81 typedef struct {
82     int            nr;          /* The number of exclusions             */
83     atom_id       *e;           /* The excluded atoms                   */
84 } t_excls;
85
86 typedef struct {
87     char            **name;
88     int               nrexcl;       /* Number of exclusions per atom    */
89     gmx_bool          excl_set;     /* Have exclusions been generated?  */
90     gmx_bool          bProcessed;   /* Has the mol been processed           */
91     t_atoms           atoms;        /* Atoms                                */
92     t_block           cgs;          /* Charge groups                        */
93     t_block           mols;         /* Molecules                            */
94     t_blocka          excls;        /* Exclusions                           */
95     t_params          plist[F_NRE]; /* Parameters in old style              */
96 } t_molinfo;
97
98 typedef struct {
99     char *name;
100     int   nr;
101 } t_mols;
102
103 gmx_bool is_int(double x);
104 /* Returns TRUE when x is integer */
105
106 typedef enum {
107     d_defaults,
108     d_atomtypes,
109     d_bondtypes,
110     d_constrainttypes,
111     d_pairtypes,
112     d_angletypes,
113     d_dihedraltypes,
114     d_nonbond_params,
115     d_implicit_genborn_params,
116     d_implicit_surface_params,
117     d_cmaptypes,
118     d_moleculetype,
119     d_atoms,
120     d_vsites2,
121     d_vsites3,
122     d_vsites4,
123     d_vsitesn,
124     d_bonds,
125     d_exclusions,
126     d_pairs,
127     d_pairs_nb,
128     d_angles,
129     d_dihedrals,
130     d_constraints,
131     d_settles,
132     d_polarization,
133     d_water_polarization,
134     d_thole_polarization,
135     d_system,
136     d_molecules,
137     d_position_restraints,
138     d_angle_restraints,
139     d_angle_restraints_z,
140     d_distance_restraints,
141     d_orientation_restraints,
142     d_dihedral_restraints,
143     d_cmap,
144     d_maxdir,
145     d_invalid,
146     d_none
147 } directive;
148
149 static const char *ds[d_maxdir+1] = {
150     "defaults",
151     "atomtypes",
152     "bondtypes",
153     "constrainttypes",
154     "pairtypes",
155     "angletypes",
156     "dihedraltypes",
157     "nonbond_params",
158     "implicit_genborn_params",
159     "implicit_surface_params",
160     "cmaptypes",
161     /* All the directives above can not appear after moleculetype */
162     "moleculetype",
163     "atoms",
164     "virtual_sites2",
165     "virtual_sites3",
166     "virtual_sites4",
167     "virtual_sitesn",
168     "bonds",
169     "exclusions",
170     "pairs",
171     "pairs_nb",
172     "angles",
173     "dihedrals",
174     "constraints",
175     "settles",
176     "polarization",
177     "water_polarization",
178     "thole_polarization",
179     "system",
180     "molecules",
181     "position_restraints",
182     "angle_restraints",
183     "angle_restraints_z",
184     "distance_restraints",
185     "orientation_restraints",
186     "dihedral_restraints",
187     "cmap",
188     "invalid"
189 };
190
191 #ifdef __cplusplus
192 }
193 #endif
194
195 #endif  /* _grompp_h */