changed reading hint
[gromacs/adressmacs.git] / src / gmxlib / ifunc.c
blobf141bbf914962b4c840b559d972eb97ab2f1b15e
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 2.0
12 * Copyright (c) 1991-1999
13 * BIOSON Research Institute, Dept. of Biophysical Chemistry
14 * University of Groningen, The Netherlands
16 * Please refer to:
17 * GROMACS: A message-passing parallel molecular dynamics implementation
18 * H.J.C. Berendsen, D. van der Spoel and R. van Drunen
19 * Comp. Phys. Comm. 91, 43-56 (1995)
21 * Also check out our WWW page:
22 * http://md.chem.rug.nl/~gmx
23 * or e-mail to:
24 * gromacs@chem.rug.nl
26 * And Hey:
27 * Green Red Orange Magenta Azure Cyan Skyblue
29 static char *SRCID_ifunc_c = "$Id$";
31 #include "typedefs.h"
32 #include "bondf.h"
33 #include "disre.h"
35 #define def_bonded(str,lstr,nra,nrpa,nrpb,ind,func)\
36 {str,lstr,(nra),(nrpa),(nrpb),IF_BOND, (ind),(func)}
38 #define def_angle(str,lstr,nra,nrpa,nrpb,ind,func)\
39 {str,lstr,(nra),(nrpa),(nrpb),IF_BOND | IF_ATYPE,(ind),(func)}
41 #define def_bond(str,lstr,nra,nrpa,nrpb,ind,func)\
42 {str,lstr,(nra),(nrpa),(nrpb),IF_BOND | IF_CONNECT | IF_BTYPE,(ind),(func)}
44 #define def_dummy(str,lstr,nra,nrpa)\
45 {str,lstr,(nra),(nrpa), 0,IF_DUMMY | IF_CONNECT, -1, unimplemented}
47 #define def_shk(str,lstr,nra,nrpa,nrpb)\
48 {str,lstr,(nra),(nrpa),(nrpb),IF_CONSTRAINT, -1, unimplemented}
50 #define def_shkcon(str,lstr,nra,nrpa,nrpb)\
51 {str,lstr,(nra),(nrpa),(nrpb),IF_CONSTRAINT | IF_CONNECT,-1, unimplemented}
53 #define def_nb(str,lstr,nra, nrp)\
54 {str,lstr,(nra), (nrp), 0,IF_NULL, -1,unimplemented}
56 #define def_nofc(str,lstr)\
57 {str,lstr, 0, 0, 0,IF_NULL, -1,unimplemented}
59 /* this MUST correspond to the enum in include/types/idef.h */
60 t_interaction_function interaction_function[F_NRE]=
62 def_bond ("BONDS", "Bond", 2, 2, 2, eNR_BONDS, bonds ),
63 def_bond ("G96BONDS", "G96Bond", 2, 2, 2, eNR_BONDS, g96bonds ),
64 def_bond ("MORSE", "Morse", 2, 3, 0, eNR_MORSE, morsebonds),
65 def_angle ("ANGLES", "Angle", 3, 2, 2, eNR_ANGLES, angles ),
66 def_angle ("G96ANGLES","G96Angle", 3, 2, 2, eNR_ANGLES, g96angles),
67 def_bonded ("PDIHS", "Proper Dih.", 4, 3, 3, eNR_PROPER, pdihs ),
68 def_bonded ("RBDIHS", "Ryckaert-Bell.", 4, 6, 0, eNR_RB, rbdihs ),
69 def_bonded ("IDIHS", "Improper Dih.", 4, 2, 2, eNR_IMPROPER,idihs ),
70 def_bonded ("LJ14", "LJ-14", 2, 2, 2, eNR_LJC, do_14 ),
71 def_nofc ("COUL14", "Coulomb-14" ),
72 def_nb ("LJ", "LJ", 2, 2 ),
73 def_nb ("BHAM", "BuckingHam", 2, 3 ),
74 def_nofc ("LJLR", "LJ (LR)" ),
75 def_nofc ("DISPCORR", "Disper. corr." ),
76 def_nofc ("SR", "Coulomb (SR)" ),
77 def_nofc ("LR", "Coulomb (LR)" ),
78 def_bonded ("WATERPOL", "Water Pol.", 1, 6, 0, eNR_WPOL, water_pol),
79 def_bonded ("POSRES", "Position Rest.", 1, 3, 0, eNR_POSRES, posres ),
80 def_bonded ("DISRES", "Dis. Res", 2, 6, 0, eNR_DISRES, ta_disres),
81 def_bonded ("ANGRES", "Angle Rest.", 4, 3, 3, eNR_ANGRES, angres ),
82 def_bonded ("ANGRESZ", "Angle Rest. Z", 2, 3, 3, eNR_ANGRESZ,angresz ),
83 def_shkcon ("CONSTR", "Constraint", 2, 1, 1 ),
84 def_shk ("CONSTRNC", "Constr. No Conn.",2, 1, 1 ),
85 def_shk ("SETTLE", "Settle", 1, 2, 0 ),
86 def_dummy ("DUMMY2", "Dummy2", 3, 1 ),
87 def_dummy ("DUMMY3", "Dummy3", 4, 2 ),
88 def_dummy ("DUMMY3FD", "Dummy3fd", 4, 2 ),
89 def_dummy ("DUMMY3FAD","Dummy3fad", 4, 2 ),
90 def_dummy ("DUMMY3OUT","Dummy3out", 4, 3 ),
91 def_dummy ("DUMMY4FD", "Dummy4fd", 5, 3 ),
92 def_nofc ("EPOT", "Potential" ),
93 def_nofc ("EKIN", "Kinetic En." ),
94 def_nofc ("ETOT", "Total Energy" ),
95 def_nofc ("TEMP", "Temperature" ),
96 def_nofc ("PRES", "Pressure" ),
97 def_nofc ("DV/DL", "dVpot/dlambda" ),
98 def_nofc ("DK/DL", "dEkin/dlambda" )
101 bool have_interaction(t_idef *idef,int ftype)
103 int i;
105 for(i=0; (i<idef->ntypes); i++)
106 if (idef->functype[i] == ftype)
107 return TRUE;
108 return FALSE;