8ced8d3a2a240433c4180cb967c6797a2d125173
[alexxy/gromacs.git] / include / force.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  * Good ROcking Metal Altar for Chronical Sinners
28  */
29
30 #ifndef _force_h
31 #define _force_h
32
33 static char *SRCID_force_h = "$Id$";
34
35 #ifdef HAVE_CONFIG_H
36 #include <config.h>
37 #endif
38
39 #ifdef HAVE_IDENT
40 #ident  "@(#) force.h 1.53 5/15/97"
41 #endif /* HAVE_IDENT */
42 #include "typedefs.h"
43 #include "pbc.h"
44 #include "nsb.h"
45 #include "network.h"
46 #include "tgroup.h"
47
48
49 extern void calc_vir(FILE *log,int nxf,rvec x[],rvec f[],tensor vir,
50                      t_commrec *cr);
51 /* Calculate virial for nxf atoms, and add it to vir */
52
53 extern void f_calc_vir(FILE *log,int i0,int i1,rvec x[],rvec f[],tensor vir,
54                        t_commrec *cr,t_graph *g,rvec shift_vec[]);
55 /* Calculate virial taking periodicity into account */
56
57 extern t_forcerec *mk_forcerec(void);
58
59 extern void make_tables(FILE *fp,t_forcerec *fr,bool bVerbose,char *fn);
60 /* Make tables for inner loops. When bVerbose the tables are printed
61  * to .xvg files
62  */
63  
64 extern void pr_forcerec(FILE *log,t_forcerec *fr,t_commrec *cr);
65
66 extern void init_forcerec(FILE       *log,     
67                           t_forcerec *fr,   
68                           t_inputrec *ir,   
69                           t_topology *top,
70                           t_commrec  *cr,
71                           t_mdatoms  *mdatoms,
72                           t_nsborder *nsb,
73                           matrix     box,
74                           bool       bMolEpot,
75                           char       *tabfn);
76 /* The Force rec struct must be created with mk_forcerec 
77  * The booleans have the following meaning:
78  * bSetQ:    Copy the charges [ only necessary when they change ]
79  * bMolEpot: Use the free energy stuff per molecule
80  */
81  
82 extern void update_forcerec(FILE *log,t_forcerec *fr,matrix box);
83 /* Updates parameters in the forcerec that are time dependent */
84
85 extern void set_avcsix(FILE *log,t_forcerec *fr,t_mdatoms *mdatoms);
86 /* Compute the average C6 param for LJ corrections */
87
88 extern void ns(FILE *log,
89                t_forcerec *fr,
90                rvec       x[],
91                rvec       f[],
92                matrix     box,
93                t_groups   *grps,
94                t_grpopts  *opts,
95                t_topology *top,
96                t_mdatoms  *md,
97                t_commrec  *cr,
98                t_nrnb     *nrnb,
99                t_nsborder *nsb,
100                int        step,
101                real       lambda,
102                real       *dvdlambda);
103 /* Call the neighborsearcher */
104
105 extern void force(FILE *log,  
106                   int          step,
107                   t_forcerec   *fr,
108                   t_inputrec   *ir,
109                   t_idef       *idef,
110                   t_nsborder   *nsb,
111                   t_commrec    *cr,
112                   t_nrnb       *nrnb,
113                   t_groups     *grps,
114                   t_mdatoms    *md,
115                   int          ngener,
116                   t_grpopts    *opts,
117                   rvec x[],
118                   rvec f[],    
119                   real epot[], bool bVerbose,
120                   matrix       box,
121                   real         lambda,
122                   t_graph      *graph,
123                   t_block      *excl,
124                   bool         bNBonly,
125                   matrix       lr_vir,
126                   rvec         mu_tot,
127                   real         qsum,
128                   bool         bGatherOnly);
129 /* Call all the force routines */
130
131 /* Routine from fnbf.m4 */
132 extern void do_fnbf(FILE *log,t_commrec *cr,t_forcerec *fr,
133                     rvec x[],rvec f[],t_mdatoms *md,
134                     real egnb[],real egcoul[],rvec box_size,
135                     t_nrnb *nrnb,real lambda,real *dvdlambda,
136                     bool bLR,int eNL);
137
138 #endif  /* _force_h */