3 * This source code is part of
7 * GROningen MAchine for Chemical Simulations
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
33 * GRoups of Organic Molecules in ACtion for Science
47 /* check kernel/toppush.c when you change these numbers */
49 #define MAXFORCEPARAM 12
53 typedef atom_id t_iatom;
55 /* this MUST correspond to the
56 t_interaction_function[F_NRE] in gmxlib/ifunc.c */
134 F_VTEMP_NOLONGERUSED,
144 F_DVDL_TEMPERATURE, /* not calculated for now, but should just be the energy (NVT) or enthalpy (NPT), or 0 (NVE) */
145 F_NRE /* This number is for the total number of energies */
148 #define IS_RESTRAINT_TYPE(ifunc) (((ifunc == F_POSRES) || (ifunc == F_DISRES) || (ifunc == F_RESTRBONDS) || (ifunc == F_DISRESVIOL) || (ifunc == F_ORIRES) || (ifunc == F_ORIRESDEV) || (ifunc == F_ANGRES) || (ifunc == F_ANGRESZ) || (ifunc == F_DIHRES)))
150 /* A macro for checking if ftype is an explicit pair-listed LJ or COULOMB
152 * bonded LJ (usually 1-4), or special listed non-bonded for FEP.
154 #define IS_LISTED_LJ_C(ftype) ((ftype) >= F_LJ14 && (ftype) <= F_LJC_PAIRS_NB)
158 /* Some parameters have A and B values for free energy calculations.
159 * The B values are not used for regular simulations of course.
160 * Free Energy for nonbondeds can be computed by changing the atom type.
161 * The harmonic type is used for all harmonic potentials:
162 * bonds, angles and improper dihedrals
168 real rA, krA, rB, krB;
171 real klinA, aA, klinB, aB;
174 real lowA, up1A, up2A, kA, lowB, up1B, up2B, kB;
176 /* No free energy supported for cubic bonds, FENE, WPOL or cross terms */
187 real r1e, r2e, r3e, krt;
190 real thetaA, kthetaA, r13A, kUBA, thetaB, kthetaB, r13B, kUBB;
199 real alpha, drcut, khyp;
202 real al_x, al_y, al_z, rOH, rHH, rOD;
205 real a, alpha1, alpha2, rfac;
211 real c6A, c12A, c6B, c12B;
214 real fqq, qi, qj, c6, c12;
217 real qi, qj, c6, c12;
219 /* Proper dihedrals can not have different multiplicity when
220 * doing free energy calculations, because the potential would not
221 * be periodic anymore.
224 real phiA, cpA; int mult; real phiB, cpB;
229 /* Settle can not be used for Free energy calculations of water bond geometry.
230 * Use shake (or lincs) instead if you have to change the water bonds.
236 real b0A, cbA, betaA, b0B, cbB, betaB;
239 real pos0A[DIM], fcA[DIM], pos0B[DIM], fcB[DIM];
242 real pos0[DIM], r, k; int geom;
245 real rbcA[NR_RBDIHS], rbcB[NR_RBDIHS];
248 real a, b, c, d, e, f;
253 /* NOTE: npair is only set after reading the tpx file */
255 real low, up1, up2, kfac; int type, label, npair;
258 real phiA, dphiA, kfacA, phiB, dphiB, kfacB;
261 int ex, power, label; real c, obs, kfac;
264 int table; real kA; real kB;
267 real sar, st, pi, gbr, bmlt;
273 real buf[MAXFORCEPARAM];
274 } generic; /* Conversion */
277 typedef int t_functype;
280 * The nonperturbed/perturbed interactions are now separated (sorted) in the
281 * ilist, such that the first 0..(nr_nonperturbed-1) ones are exactly that, and
282 * the remaining ones from nr_nonperturbed..(nr-1) are perturbed bonded
294 * The struct t_ilist defines a list of atoms with their interactions.
295 * General field description:
297 * the size (nr elements) of the interactions array (iatoms[]).
299 * specifies which atoms are involved in an interaction of a certain
300 * type. The layout of this array is as follows:
302 * +-----+---+---+---+-----+---+---+-----+---+---+---+-----+---+---+...
303 * |type1|at1|at2|at3|type2|at1|at2|type1|at1|at2|at3|type3|at1|at2|
304 * +-----+---+---+---+-----+---+---+-----+---+---+---+-----+---+---+...
306 * So for interaction type type1 3 atoms are needed, and for type2 and
307 * type3 only 2. The type identifier is used to select the function to
308 * calculate the interaction and its actual parameters. This type
309 * identifier is an index in a params[] and functype[] array.
314 real *cmap; /* Has length 4*grid_spacing*grid_spacing, */
315 /* there are 4 entries for each cmap type (V,dVdx,dVdy,d2dVdxdy) */
320 int ngrid; /* Number of allocated cmap (cmapdata_t ) grids */
321 int grid_spacing; /* Grid spacing */
322 cmapdata_t *cmapdata; /* Pointer to grid with actual, pre-interpolated data */
330 t_functype *functype;
332 double reppow; /* The repulsion power for VdW: C12*r^-reppow */
333 real fudgeQQ; /* The scaling factor for Coulomb 1-4: f*q1*q2 */
334 gmx_cmap_t cmap_grid; /* The dihedral correction maps */
338 ilsortUNKNOWN, ilsortNO_FE, ilsortFE_UNSORTED, ilsortFE_SORTED
345 t_functype *functype;
348 gmx_cmap_t cmap_grid;
349 t_iparams *iparams_posres, *iparams_fbposres;
350 int iparams_posres_nalloc, iparams_fbposres_nalloc;
355 int *il_thread_division;
356 int il_thread_division_nalloc;
360 * The struct t_idef defines all the interactions for the complete
361 * simulation. The structure is setup in such a way that the multinode
362 * version of the program can use it as easy as the single node version.
363 * General field description:
365 * defines the number of elements in functype[] and param[].
367 * the node id (if parallel machines)
369 * the number of atomtypes
370 * t_functype *functype
371 * array of length ntypes, defines for every force type what type of
372 * function to use. Every "bond" with the same function but different
373 * force parameters is a different force type. The type identifier in the
374 * forceatoms[] array is an index in this array.
376 * array of length ntypes, defines the parameters for every interaction
377 * type. The type identifier in the actual interaction list
378 * (ilist[ftype].iatoms[]) is an index in this array.
379 * gmx_cmap_t cmap_grid
380 * the grid for the dihedral pair correction maps.
381 * t_iparams *iparams_posres, *iparams_fbposres
382 * defines the parameters for position restraints only.
383 * Position restraints are the only interactions that have different
384 * parameters (reference positions) for different molecules
385 * of the same type. ilist[F_POSRES].iatoms[] is an index in this array.
387 * The list of interactions for each type. Note that some,
388 * such as LJ and COUL will have 0 entries.
390 * The state of the sorting of il, values are provided above.
392 * The number of threads used to set il_thread_division.
393 * int *il_thread_division
394 * The division of the normal bonded interactions of threads.
395 * il_thread_division[ftype*(nthreads+1)+t] contains an index
396 * into il[ftype].iatoms; thread th operates on t=th to t=th+1.
397 * int il_thread_division_nalloc
398 * The allocated size of il_thread_division,
399 * should be at least F_NRE*(nthreads+1).
403 int n; /* n+1 is the number of points */
404 real scale; /* distance between two points */
405 real *data; /* the actual table data, per point there are 4 numbers */