1adb5aa31d59ea818f13098597250c2ba90ab4fa
[alexxy/gromacs.git] / include / types / forcerec.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 2.0
11  * 
12  * Copyright (c) 1991-1999
13  * BIOSON Research Institute, Dept. of Biophysical Chemistry
14  * University of Groningen, The Netherlands
15  * 
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)
20  * 
21  * Also check out our WWW page:
22  * http://md.chem.rug.nl/~gmx
23  * or e-mail to:
24  * gromacs@chem.rug.nl
25  * 
26  * And Hey:
27  * Green Red Orange Magenta Azure Cyan Skyblue
28  */
29
30 #ifdef HAVE_CONFIG_H
31 #include <config.h>
32 #endif
33
34 enum { eNL_VDWQQ, eNL_VDW, eNL_QQ, 
35        eNL_VDWQQ_FREE, eNL_VDW_FREE, eNL_QQ_FREE, 
36        eNL_VDWQQ_SOLMNO, eNL_VDW_SOLMNO, eNL_QQ_SOLMNO, 
37        eNL_VDWQQ_WATER, eNL_QQ_WATER, 
38        eNL_VDWQQ_WATERWATER, eNL_QQ_WATERWATER, 
39        eNL_NR };
40  
41 typedef struct {
42   /* Cut-Off stuff */
43   int  ePBC;
44   real rlist,rlistlong;
45   
46   /* Dielectric constant resp. multiplication factor for charges */
47   real zsquare,temp;
48   real epsilon_r,epsfac;  
49   
50   /* Constants for reaction fields */
51   bool bRF;
52   real kappa,k_rf,c_rf;
53   
54   /* Constant for long range dispersion correction (average dispersion) */
55   real avcsix;
56       
57   /* Fudge factors */
58   real fudgeQQ;
59
60   /* Table stuff */
61   bool bcoultab;
62   bool bvdwtab;
63   real rtab;
64   int  ntab;
65   real tabscale;
66   /* We duplicate tables for cache optimization purposes */
67   real *coultab;      /* Coul only */
68   real *vdwtab;       /* Vdw only   */
69   real *coulvdwtab;   /* Both      */
70   real *coulvdw14tab; /* 1,4 table with both */
71
72   /* PPPM & Shifting stuff */
73   real rcoulomb_switch,rcoulomb;
74   real *phi;
75
76   /* VdW stuff */
77   real rvdw_switch,rvdw;
78   real bham_b_max;
79   real tabscale_exp;
80
81   /* Free energy ? */
82   int  efep;
83   real sc_alpha;
84   real sc_sigma6;
85
86   /* NS Stuff */
87   int  eeltype;
88   int  vdwtype;
89   int  cg0,hcg;
90   int  ndelta;
91   bool bSolvOpt;
92   int  nMNOMol;
93   real nMNOav[3];
94   int  nWatMol;
95   int  Dimension;
96   bool bGrid,bDomDecomp;
97   int  *solvent_type;
98   int  *mno_index;
99   rvec *cg_cm;
100   rvec *shift_vec;
101   
102   /* The actual neighbor lists, short and long range, see enum above
103    * for definition of neighborlist indices.
104    */
105   t_nblist nlist_sr[eNL_NR];
106   t_nblist nlist_lr[eNL_NR];
107   
108   /* This mask array of length nn determines whether or not this bit of the
109    * neighbourlists should be computed. Usually all these are true of course,
110    * but not when shells are used. During minimisation all the forces that 
111    * include shells are done, then after minimsation is converged the remaining
112    * forces are computed.
113    */
114   /* bool *bMask; */
115     
116   /* Twin Range stuff. */
117   bool bTwinRange;
118   int  nlr;
119   rvec *f_twin;
120   rvec *fshift_twin;
121   
122   /* PME/Ewald stuff */
123   rvec *f_pme;
124   bool bEwald;
125   real ewaldcoeff;
126
127   /* Virial Stuff */
128   rvec *fshift;
129   
130   /* Free energy stuff */
131   int     nmol;
132   atom_id *mol_nr;
133   real    *mol_epot;
134   int     nstcalc;
135   
136   /* Non bonded Parameter lists */
137   int  ntype; /* Number of atom types */
138   bool bBHAM;
139   real *nbfp;
140
141   /* Energy group exclusions */
142   bool *eg_excl;
143
144   /* xmdrun directional minimization */
145   real k_dirmin;
146 } t_forcerec;
147
148 #define C6(nbfp,ntp,ai,aj)     (nbfp)[2*((ntp)*(ai)+(aj))]
149 #define C12(nbfp,ntp,ai,aj)    (nbfp)[2*((ntp)*(ai)+(aj))+1]
150 #define BHAMC(nbfp,ntp,ai,aj)  (nbfp)[3*((ntp)*(ai)+(aj))]
151 #define BHAMA(nbfp,ntp,ai,aj)  (nbfp)[3*((ntp)*(ai)+(aj))+1]
152 #define BHAMB(nbfp,ntp,ai,aj)  (nbfp)[3*((ntp)*(ai)+(aj))+2]