Tagged files with gromacs 3.0 header and added some license info
[alexxy/gromacs.git] / include / types / ifunc.h
1 /*
2  * $Id$
3  * 
4  *                This source code is part of
5  * 
6  *                 G   R   O   M   A   C   S
7  * 
8  *          GROningen MAchine for Chemical Simulations
9  * 
10  *                        VERSION 3.0
11  * 
12  * Copyright (c) 1991-2001
13  * BIOSON Research Institute, Dept. of Biophysical Chemistry
14  * University of Groningen, The Netherlands
15  * 
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.
20  * 
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.
27  * 
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.
30  * 
31  * Do check out http://www.gromacs.org , or mail us at gromacs@gromacs.org .
32  * 
33  * And Hey:
34  * Good ROcking Metal Altar for Chronical Sinners
35  */
36 #ifdef HAVE_CONFIG_H
37 #include <config.h>
38 #endif
39
40 #ifndef _ifunc_h
41 #define _ifunc_h
42
43
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[]);
48 /*
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.
55  */
56
57 #define IF_NULL       0
58 #define IF_BOND       1
59 #define IF_DUMMY      1<<1
60 #define IF_CONSTRAINT 1<<2
61 #define IF_CONNECT    1<<3
62 #define IF_BTYPE      1<<5
63 #define IF_ATYPE      1<<6
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.
69  */
70 typedef struct
71 {
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;
83
84 #define NRFP(ftype) (interaction_function[(ftype)].nrfpA+interaction_function[(ftype)].nrfpB)
85 #define NRAL(ftype) (interaction_function[(ftype)].nratoms)
86
87 extern t_interaction_function interaction_function[F_NRE];
88 /* initialised interaction functions descriptor                         */
89
90 #endif
91