Revertiing my fake merge to make history consistent
[gromacs/adressmacs.git] / include / types / idef.h
blob2f92ab6436d448f65850b64c3544f6231b517d8c
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.
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.
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.
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.
30 * For more info, check our website at http://www.gromacs.org
32 * And Hey:
33 * GRoups of Organic Molecules in ACtion for Science
35 #ifdef HAVE_CONFIG_H
36 #include <config.h>
37 #endif
39 #ifndef _idef_h
40 #define _idef_h
42 #include "simple.h"
44 #ifdef __cplusplus
45 extern "C" {
46 #endif
49 /* check kernel/toppush.c when you change these numbers */
50 #define MAXATOMLIST 6
51 #define MAXFORCEPARAM 12
52 #define NR_RBDIHS 6
53 #define NR_FOURDIHS 4
55 typedef atom_id t_iatom;
57 /* this MUST correspond to the
58 t_interaction_function[F_NRE] in gmxlib/ifunc.c */
59 enum {
60 F_BONDS,
61 F_G96BONDS,
62 F_MORSE,
63 F_CUBICBONDS,
64 F_CONNBONDS,
65 F_HARMONIC,
66 F_FENEBONDS,
67 F_TABBONDS,
68 F_TABBONDSNC,
69 F_RESTRBONDS,
70 F_ANGLES,
71 F_G96ANGLES,
72 F_CROSS_BOND_BONDS,
73 F_CROSS_BOND_ANGLES,
74 F_UREY_BRADLEY,
75 F_QUARTIC_ANGLES,
76 F_TABANGLES,
77 F_PDIHS,
78 F_RBDIHS,
79 F_FOURDIHS,
80 F_IDIHS,
81 F_PIDIHS,
82 F_TABDIHS,
83 F_CMAP,
84 F_GB12,
85 F_GB13,
86 F_GB14,
87 F_GBPOL,
88 F_NPSOLVATION,
89 F_LJ14,
90 F_COUL14,
91 F_LJC14_Q,
92 F_LJC_PAIRS_NB,
93 F_LJ,
94 F_BHAM,
95 F_LJ_LR,
96 F_BHAM_LR,
97 F_DISPCORR,
98 F_COUL_SR,
99 F_COUL_LR,
100 F_RF_EXCL,
101 F_COUL_RECIP,
102 F_DPD,
103 F_POLARIZATION,
104 F_WATER_POL,
105 F_THOLE_POL,
106 F_POSRES,
107 F_DISRES,
108 F_DISRESVIOL,
109 F_ORIRES,
110 F_ORIRESDEV,
111 F_ANGRES,
112 F_ANGRESZ,
113 F_DIHRES,
114 F_DIHRESVIOL,
115 F_CONSTR,
116 F_CONSTRNC,
117 F_SETTLE,
118 F_VSITE2,
119 F_VSITE3,
120 F_VSITE3FD,
121 F_VSITE3FAD,
122 F_VSITE3OUT,
123 F_VSITE4FD,
124 F_VSITE4FDN,
125 F_VSITEN,
126 F_COM_PULL,
127 F_EQM,
128 F_EPOT,
129 F_EKIN,
130 F_ETOT,
131 F_ECONSERVED,
132 F_TEMP,
133 F_VTEMP,
134 F_PDISPCORR,
135 F_PRES,
136 F_DVDL,
137 F_DKDL,
138 F_DHDL_CON,
139 F_NRE /* This number is for the total number of energies */
142 typedef union
144 /* Some parameters have A and B values for free energy calculations.
145 * The B values are not used for regular simulations of course.
146 * Free Energy for nonbondeds can be computed by changing the atom type.
147 * The harmonic type is used for all harmonic potentials:
148 * bonds, angles and improper dihedrals
150 struct {real a,b,c; } bham;
151 struct {real rA,krA,rB,krB; } harmonic;
152 struct {real lowA,up1A,up2A,kA,lowB,up1B,up2B,kB; } restraint;
153 /* No free energy supported for cubic bonds, FENE, WPOL or cross terms */
154 struct {real b0,kb,kcub; } cubic;
155 struct {real bm,kb; } fene;
156 struct {real r1e,r2e,krr; } cross_bb;
157 struct {real r1e,r2e,r3e,krt; } cross_ba;
158 struct {real theta,ktheta,r13,kUB; } u_b;
159 struct {real theta,c[5]; } qangle;
160 struct {real alpha; } polarize;
161 struct {real al_x,al_y,al_z,rOH,rHH,rOD; } wpol;
162 struct {real a,alpha1,alpha2,rfac; } thole;
163 struct {real c6,c12; } lj;
164 struct {real c6A,c12A,c6B,c12B; } lj14;
165 struct {real fqq,qi,qj,c6,c12; } ljc14;
166 struct {real qi,qj,c6,c12; } ljcnb;
167 /* Proper dihedrals can not have different multiplicity when
168 * doing free energy calculations, because the potential would not
169 * be periodic anymore.
171 struct {real phiA,cpA;int mult;real phiB,cpB; } pdihs;
172 struct {real dA,dB; } constr;
173 /* Settle can not be used for Free energy calculations of water bond geometry.
174 * Use shake (or lincs) instead if you have to change the water bonds.
176 struct {real doh,dhh; } settle;
177 /* No free energy supported for morse bonds */
178 struct {real b0,cb,beta; } morse;
179 struct {real pos0A[DIM],fcA[DIM],pos0B[DIM],fcB[DIM]; } posres;
180 struct {real rbcA[NR_RBDIHS], rbcB[NR_RBDIHS]; } rbdihs;
181 struct {real a,b,c,d,e,f; } vsite;
182 struct {int n; real a; } vsiten;
183 /* NOTE: npair is only set after reading the tpx file */
184 struct {real low,up1,up2,kfac;int type,label,npair; } disres;
185 struct {real phi,dphi,kfac;int label,power; } dihres;
186 struct {int ex,power,label; real c,obs,kfac; } orires;
187 struct {int table;real kA;real kB; } tab;
188 struct {real sar,st,pi,gbr,bmlt; } gb;
189 struct {int cmapA,cmapB; } cmap;
190 struct {real buf[MAXFORCEPARAM]; } generic; /* Conversion */
191 } t_iparams;
193 typedef int t_functype;
196 * The nonperturbed/perturbed interactions are now separated (sorted) in the
197 * ilist, such that the first 0..(nr_nonperturbed-1) ones are exactly that, and
198 * the remaining ones from nr_nonperturbed..(nr-1) are perturbed bonded
199 * interactions.
201 typedef struct
203 int nr;
204 int nr_nonperturbed;
205 t_iatom *iatoms;
206 int nalloc;
207 } t_ilist;
210 * The struct t_ilist defines a list of atoms with their interactions.
211 * General field description:
212 * int nr
213 * the size (nr elements) of the interactions array (iatoms[]).
214 * t_iatom *iatoms
215 * specifies which atoms are involved in an interaction of a certain
216 * type. The layout of this array is as follows:
218 * +-----+---+---+---+-----+---+---+-----+---+---+---+-----+---+---+...
219 * |type1|at1|at2|at3|type2|at1|at2|type1|at1|at2|at3|type3|at1|at2|
220 * +-----+---+---+---+-----+---+---+-----+---+---+---+-----+---+---+...
222 * So for interaction type type1 3 atoms are needed, and for type2 and
223 * type3 only 2. The type identifier is used to select the function to
224 * calculate the interaction and its actual parameters. This type
225 * identifier is an index in a params[] and functype[] array.
228 typedef struct
230 real *cmap; /* Has length 4*grid_spacing*grid_spacing, */
231 /* there are 4 entries for each cmap type (V,dVdx,dVdy,d2dVdxdy) */
232 } cmapdata_t;
234 typedef struct
236 int ngrid; /* Number of allocated cmap (cmapdata_t ) grids */
237 int grid_spacing; /* Grid spacing */
238 cmapdata_t *cmapdata; /* Pointer to grid with actual, pre-interpolated data */
239 } gmx_cmap_t;
242 typedef struct
244 int ntypes;
245 int atnr;
246 t_functype *functype;
247 t_iparams *iparams;
248 double reppow; /* The repulsion power for VdW: C12*r^-reppow */
249 real fudgeQQ; /* The scaling factor for Coulomb 1-4: f*q1*q2 */
250 gmx_cmap_t cmap_grid; /* The dihedral correction maps */
251 } gmx_ffparams_t;
253 enum {
254 ilsortUNKNOWN, ilsortNO_FE, ilsortFE_UNSORTED, ilsortFE_SORTED
257 typedef struct
259 int ntypes;
260 int atnr;
261 t_functype *functype;
262 t_iparams *iparams;
263 real fudgeQQ;
264 gmx_cmap_t cmap_grid;
265 t_iparams *iparams_posres;
266 int iparams_posres_nalloc;
268 t_ilist il[F_NRE];
269 int ilsort;
270 } t_idef;
273 * The struct t_idef defines all the interactions for the complete
274 * simulation. The structure is setup in such a way that the multinode
275 * version of the program can use it as easy as the single node version.
276 * General field description:
277 * int ntypes
278 * defines the number of elements in functype[] and param[].
279 * int nodeid
280 * the node id (if parallel machines)
281 * int atnr
282 * the number of atomtypes
283 * t_functype *functype
284 * array of length ntypes, defines for every force type what type of
285 * function to use. Every "bond" with the same function but different
286 * force parameters is a different force type. The type identifier in the
287 * forceatoms[] array is an index in this array.
288 * t_iparams *iparams
289 * array of length ntypes, defines the parameters for every interaction
290 * type. The type identifier in the actual interaction list
291 * (ilist[ftype].iatoms[]) is an index in this array.
292 * gmx_cmap_t cmap_grid
293 * the grid for the dihedral pair correction maps.
294 * t_iparams *iparams_posres
295 * defines the parameters for position restraints only.
296 * Position restraints are the only interactions that have different
297 * parameters (reference positions) for different molecules
298 * of the same type. ilist[F_POSRES].iatoms[] is an index in this array.
299 * t_ilist il[F_NRE]
300 * The list of interactions for each type. Note that some,
301 * such as LJ and COUL will have 0 entries.
304 typedef struct {
305 int n; /* n+1 is the number of points */
306 real scale; /* distance between two points */
307 real *tab; /* the actual tables, per point there are 4 numbers */
308 } bondedtable_t;
310 #ifdef __cplusplus
312 #endif
315 #endif