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,2018, 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.
37 #ifndef GMX_TOPOLOGY_IDEF_H
38 #define GMX_TOPOLOGY_IDEF_H
42 #include "gromacs/math/vectypes.h"
43 #include "gromacs/utility/basedefinitions.h"
44 #include "gromacs/utility/real.h"
50 /* check kernel/toppush.c when you change these numbers */
52 #define MAXFORCEPARAM 12
59 /* this MUST correspond to the
60 t_interaction_function[F_NRE] in gmxlib/ifunc.c */
94 F_NPSOLVATION_NOLONGERUSED,
101 F_LJ_LR_NOLONGERUSED,
102 F_BHAM_LR_NOLONGERUSED,
105 F_COUL_LR_NOLONGERUSED,
142 F_VTEMP_NOLONGERUSED,
152 F_DVDL_TEMPERATURE, /* not calculated for now, but should just be the energy (NVT) or enthalpy (NPT), or 0 (NVE) */
153 F_NRE /* This number is for the total number of energies */
156 #define IS_RESTRAINT_TYPE(ifunc) (((ifunc == F_POSRES) || (ifunc == F_FBPOSRES) || (ifunc == F_DISRES) || (ifunc == F_RESTRBONDS) || (ifunc == F_DISRESVIOL) || (ifunc == F_ORIRES) || (ifunc == F_ORIRESDEV) || (ifunc == F_ANGRES) || (ifunc == F_ANGRESZ) || (ifunc == F_DIHRES)))
158 typedef union t_iparams
160 /* Some parameters have A and B values for free energy calculations.
161 * The B values are not used for regular simulations of course.
162 * Free Energy for nonbondeds can be computed by changing the atom type.
163 * The harmonic type is used for all harmonic potentials:
164 * bonds, angles and improper dihedrals
170 real rA, krA, rB, krB;
173 real klinA, aA, klinB, aB;
176 real lowA, up1A, up2A, kA, lowB, up1B, up2B, kB;
178 /* No free energy supported for cubic bonds, FENE, WPOL or cross terms */
189 real r1e, r2e, r3e, krt;
192 real thetaA, kthetaA, r13A, kUBA, thetaB, kthetaB, r13B, kUBB;
201 real alpha, drcut, khyp;
204 real al_x, al_y, al_z, rOH, rHH, rOD;
207 real a, alpha1, alpha2, rfac;
213 real c6A, c12A, c6B, c12B;
216 real fqq, qi, qj, c6, c12;
219 real qi, qj, c6, c12;
221 /* Proper dihedrals can not have different multiplicity when
222 * doing free energy calculations, because the potential would not
223 * be periodic anymore.
226 real phiA, cpA; int mult; real phiB, cpB;
231 /* Settle can not be used for Free energy calculations of water bond geometry.
232 * Use shake (or lincs) instead if you have to change the water bonds.
238 real b0A, cbA, betaA, b0B, cbB, betaB;
241 real pos0A[DIM], fcA[DIM], pos0B[DIM], fcB[DIM];
244 real pos0[DIM], r, k; int geom;
247 real rbcA[NR_RBDIHS], rbcB[NR_RBDIHS];
250 real cbtcA[NR_CBTDIHS], cbtcB[NR_CBTDIHS];
253 real a, b, c, d, e, f;
258 /* NOTE: npair is only set after reading the tpx file */
260 real low, up1, up2, kfac; int type, label, npair;
263 real phiA, dphiA, kfacA, phiB, dphiB, kfacB;
266 int ex, power, label; real c, obs, kfac;
269 int table; real kA; real kB;
275 real buf[MAXFORCEPARAM];
276 } generic; /* Conversion */
279 typedef int t_functype;
282 * The nonperturbed/perturbed interactions are now separated (sorted) in the
283 * ilist, such that the first 0..(nr_nonperturbed-1) ones are exactly that, and
284 * the remaining ones from nr_nonperturbed..(nr-1) are perturbed bonded
287 typedef struct t_ilist
296 * The struct t_ilist defines a list of atoms with their interactions.
297 * General field description:
299 * the size (nr elements) of the interactions array (iatoms[]).
301 * specifies which atoms are involved in an interaction of a certain
302 * type. The layout of this array is as follows:
304 * +-----+---+---+---+-----+---+---+-----+---+---+---+-----+---+---+...
305 * |type1|at1|at2|at3|type2|at1|at2|type1|at1|at2|at3|type3|at1|at2|
306 * +-----+---+---+---+-----+---+---+-----+---+---+---+-----+---+---+...
308 * So for interaction type type1 3 atoms are needed, and for type2 and
309 * type3 only 2. The type identifier is used to select the function to
310 * calculate the interaction and its actual parameters. This type
311 * identifier is an index in a params[] and functype[] array.
316 real *cmap; /* Has length 4*grid_spacing*grid_spacing, */
317 /* there are 4 entries for each cmap type (V,dVdx,dVdy,d2dVdxdy) */
320 typedef struct gmx_cmap_t
322 int ngrid; /* Number of allocated cmap (cmapdata_t ) grids */
323 int grid_spacing; /* Grid spacing */
324 gmx_cmapdata_t *cmapdata; /* Pointer to grid with actual, pre-interpolated data */
328 typedef struct gmx_ffparams_t
332 t_functype *functype;
334 double reppow; /* The repulsion power for VdW: C12*r^-reppow */
335 real fudgeQQ; /* The scaling factor for Coulomb 1-4: f*q1*q2 */
336 gmx_cmap_t cmap_grid; /* The dihedral correction maps */
340 ilsortUNKNOWN, ilsortNO_FE, ilsortFE_UNSORTED, ilsortFE_SORTED
343 typedef struct t_idef
347 t_functype *functype;
350 gmx_cmap_t cmap_grid;
351 t_iparams *iparams_posres, *iparams_fbposres;
352 int iparams_posres_nalloc, iparams_fbposres_nalloc;
359 * The struct t_idef defines all the interactions for the complete
360 * simulation. The structure is setup in such a way that the multinode
361 * version of the program can use it as easy as the single node version.
362 * General field description:
364 * defines the number of elements in functype[] and param[].
366 * the node id (if parallel machines)
368 * the number of atomtypes
369 * t_functype *functype
370 * array of length ntypes, defines for every force type what type of
371 * function to use. Every "bond" with the same function but different
372 * force parameters is a different force type. The type identifier in the
373 * forceatoms[] array is an index in this array.
375 * array of length ntypes, defines the parameters for every interaction
376 * type. The type identifier in the actual interaction list
377 * (ilist[ftype].iatoms[]) is an index in this array.
378 * gmx_cmap_t cmap_grid
379 * the grid for the dihedral pair correction maps.
380 * t_iparams *iparams_posres, *iparams_fbposres
381 * defines the parameters for position restraints only.
382 * Position restraints are the only interactions that have different
383 * parameters (reference positions) for different molecules
384 * of the same type. ilist[F_POSRES].iatoms[] is an index in this array.
386 * The list of interactions for each type. Note that some,
387 * such as LJ and COUL will have 0 entries.
389 * The state of the sorting of il, values are provided above.
392 void pr_iparams(FILE *fp, t_functype ftype, const t_iparams *iparams);
393 void pr_ilist(FILE *fp, int indent, const char *title,
394 const t_functype *functype, const t_ilist *ilist,
395 gmx_bool bShowNumbers,
396 gmx_bool bShowParameters, const t_iparams *iparams);
397 void pr_ffparams(FILE *fp, int indent, const char *title,
398 const gmx_ffparams_t *ffparams, gmx_bool bShowNumbers);
399 void pr_idef(FILE *fp, int indent, const char *title, const t_idef *idef,
400 gmx_bool bShowNumbers, gmx_bool bShowParameters);