added Verlet scheme and NxN non-bonded functionality
[alexxy/gromacs.git] / include / genborn.h
1 /*
2  * 
3  *                This source code is part of
4  * 
5  *                 G   R   O   M   A   C   S
6  * 
7  *          GROningen MAchine for Chemical Simulations
8  * 
9  * Written by David van der Spoel, Erik Lindahl, Berk Hess, and others.
10  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
11  * Copyright (c) 2001-2008, The GROMACS development team,
12  * check out http://www.gromacs.org for more information.
13  
14  * This program is free software; you can redistribute it and/or
15  * modify it under the terms of the GNU General Public License
16  * as published by the Free Software Foundation; either version 2
17  * of the License, or (at your option) any later version.
18  * 
19  * If you want to redistribute modifications, please consider that
20  * scientific software is very special. Version control is crucial -
21  * bugs must be traceable. We will be happy to consider code for
22  * inclusion in the official distribution, but derived work must not
23  * be called official GROMACS. Details are found in the README & COPYING
24  * files - if they are missing, get the official version at www.gromacs.org.
25  * 
26  * To help us fund GROMACS development, we humbly ask that you cite
27  * the papers on the package - you can find them in the top README file.
28  * 
29  * For more info, check our website at http://www.gromacs.org
30  * 
31  * And Hey:
32  * Gallium Rubidium Oxygen Manganese Argon Carbon Silicon
33  */
34
35
36 #ifndef _genborn_h
37 #define _genborn_h
38
39 #include "typedefs.h"
40 #include "types/commrec.h"
41 #include "grompp.h"
42
43 #ifdef __cplusplus
44 extern "C" {
45 #endif
46
47 /* Still parameters - make sure to edit in genborn_sse.c too if you change these! */
48 #define STILL_P1  0.073*0.1              /* length        */
49 #define STILL_P2  0.921*0.1*CAL2JOULE    /* energy*length */
50 #define STILL_P3  6.211*0.1*CAL2JOULE    /* energy*length */
51 #define STILL_P4  15.236*0.1*CAL2JOULE
52 #define STILL_P5  1.254 
53
54 #define STILL_P5INV (1.0/STILL_P5)
55 #define STILL_PIP5  (M_PI*STILL_P5)
56
57
58 /* Initialise GB stuff */
59 int init_gb(gmx_genborn_t **p_born,
60             const t_commrec *cr, t_forcerec *fr, const t_inputrec *ir,
61             const gmx_mtop_t *mtop, real rgbradii, int gb_algorithm);
62
63
64 /* Born radii calculations, both with and without SSE acceleration */
65 int calc_gb_rad(t_commrec *cr, t_forcerec *fr, t_inputrec *ir,gmx_localtop_t *top,
66                                 const t_atomtypes *atype, rvec x[], t_nblist *nl, gmx_genborn_t *born,t_mdatoms *md, t_nrnb     *nrnb);
67
68
69
70 /* Bonded GB interactions */                                                            
71 real gb_bonds_tab(rvec x[], rvec f[], rvec fshift[], real *charge, real *p_gbtabscale,
72                                   real *invsqrta, real *dvda, real *GBtab, t_idef *idef, real epsilon_r,
73                                   real gb_epsilon_solvent, real facel, const t_pbc *pbc, const t_graph *graph);
74
75
76
77 void gb_pd_send(t_commrec *cr, real *send_data, int nr);
78
79
80 /* Functions for setting up the F_GB12,13,14 lists in grompp */
81 int 
82 init_gb_plist(t_params *p_list);
83
84 int 
85 convert_gb_params(gmx_ffparams_t *ffparams, t_functype ftype, t_params *gb_plist, t_ilist *il);
86
87
88
89 /* Functions for calculating adjustments due to ie chain rule terms */
90 void
91 calc_gb_forces(t_commrec *cr, t_mdatoms *md, gmx_genborn_t *born, gmx_localtop_t *top, const t_atomtypes *atype,
92                            rvec x[], rvec f[], t_forcerec *fr,t_idef *idef,int gb_algorithm, int sa_algorithm, t_nrnb *nrnb, gmx_bool bRad,
93                            const t_pbc *pbc, const t_graph *graph, gmx_enerdata_t *enerd);
94
95
96 int
97 make_gb_nblist(t_commrec *cr, int gb_algorithm, real gbcut,
98                rvec x[], matrix box,
99                t_forcerec *fr, t_idef *idef, t_graph *graph, gmx_genborn_t *born);
100
101 void 
102 make_local_gb(const t_commrec *cr, gmx_genborn_t *born, int gb_algorithm);
103
104 #ifdef __cplusplus
105 }
106 #endif
107
108 #endif /* _genborn_h */
109