4 * This source code is part of
8 * GROningen MAchine for Chemical Simulations
12 * Copyright (c) 1991-2001
13 * BIOSON Research Institute, Dept. of Biophysical Chemistry
14 * University of Groningen, The Netherlands
16 * This program is free software; you can redistribute it and/or
17 * modify it under the terms of the GNU General Public License
18 * as published by the Free Software Foundation; either version 2
19 * of the License, or (at your option) any later version.
21 * If you want to redistribute modifications, please consider that
22 * scientific software is very special. Version control is crucial -
23 * bugs must be traceable. We will be happy to consider code for
24 * inclusion in the official distribution, but derived work must not
25 * be called official GROMACS. Details are found in the README & COPYING
26 * files - if they are missing, get the official version at www.gromacs.org.
28 * To help us fund GROMACS development, we humbly ask that you cite
29 * the papers on the package - you can find them in the top README file.
31 * Do check out http://www.gromacs.org , or mail us at gromacs@gromacs.org .
34 * Good ROcking Metal Altar for Chronical Sinners
44 typedef real t_ifunc(int nbonds,t_iatom iatoms[],t_iparams *iparams,
45 rvec x[],rvec f[],t_forcerec *fr,t_graph *g,
46 matrix box,real lambd,real *dvdlambda,
47 t_mdatoms *md,int ngrp,real egnb[],real egcoul[]);
49 * The function type t_ifunc() calculates one interaction, using iatoms[]
50 * and iparams. Within the function the number of atoms to be used is
51 * known. Within the function only the atomid part of the iatoms[] array
52 * is supplied, not the type field (see also t_ilist). The function
53 * returns the potential energy. The coordinates in x are such that
54 * no calculation of PBC is necessary.
60 #define IF_CONSTRAINT 1<<2
61 #define IF_CONNECT 1<<3
64 /* These flags tell to some of the routines what can be done with this
65 * item in the list. If flags & IF_BOND, then bonded interactions will
66 * be calculated. If flags & IF_CONNECT this link specifies a connection
67 * (chemical bond) between two particles. By specifying this here, we can
68 * keep all the information in one place.
72 char *name; /* the name of this function */
73 char *longname; /* The name for printing etc. */
74 int nratoms; /* nr of atoms needed for this function */
75 int nrfpA,nrfpB; /* number of parameters for this function. */
76 /* this corresponds to the number of params in */
77 /* iparams struct! (see idef.h) */
78 /* A and B are for normal and free energy components respectively. */
79 unsigned long flags; /* Flags (see above) */
80 int nrnb_ind; /* index for nrnb (-1 if unknown) */
81 t_ifunc *ifunc; /* the function it self */
82 } t_interaction_function;
84 #define NRFP(ftype) (interaction_function[(ftype)].nrfpA+interaction_function[(ftype)].nrfpB)
85 #define NRAL(ftype) (interaction_function[(ftype)].nratoms)
87 extern t_interaction_function interaction_function[F_NRE];
88 /* initialised interaction functions descriptor */