Merge remote branch 'origin/release-4-5-patches'
[alexxy/gromacs.git] / src / gromacs / legacyheaders / types / genborn.h
1 /* -*- mode: c; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; c-file-style: "stroustrup"; -*-
2  *
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  * Written by David van der Spoel, Erik Lindahl, Berk Hess, and others.
11  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
12  * Copyright (c) 2001-2008, The GROMACS development team,
13  * check out http://www.gromacs.org for more information.
14  
15  * This program is free software; you can redistribute it and/or
16  * modify it under the terms of the GNU General Public License
17  * as published by the Free Software Foundation; either version 2
18  * of the License, or (at your option) any later version.
19  * 
20  * If you want to redistribute modifications, please consider that
21  * scientific software is very special. Version control is crucial -
22  * bugs must be traceable. We will be happy to consider code for
23  * inclusion in the official distribution, but derived work must not
24  * be called official GROMACS. Details are found in the README & COPYING
25  * files - if they are missing, get the official version at www.gromacs.org.
26  * 
27  * To help us fund GROMACS development, we humbly ask that you cite
28  * the papers on the package - you can find them in the top README file.
29  * 
30  * For more info, check our website at http://www.gromacs.org
31  * 
32  * And Hey:
33  * Gallium Rubidium Oxygen Manganese Argon Carbon Silicon
34  */
35
36
37 #ifdef __cplusplus
38 extern "C" {
39 #endif
40
41 #include "simple.h"
42
43 typedef struct
44 {
45         int nbonds;
46         int bond[10];
47         real length[10];
48 } genborn_bonds_t;
49
50 typedef struct gbtmpnbls *gbtmpnbls_t;
51
52 /* Struct to hold all the information for GB */
53 typedef struct
54 {
55         int nr;                   /* number of atoms, length of arrays below */
56         int n12;                  /* number of 1-2 (bond) interactions       */
57         int n13;                  /* number of 1-3 (angle) terms             */
58         int n14;                  /* number of 1-4 (torsion) terms           */
59         int nalloc;               /* Allocation of local arrays (with DD)    */
60   
61         
62         /* Arrays below that end with _globalindex are used for setting up initial values of
63          * all gb parameters and values. They all have length natoms, which for DD is the 
64          * global atom number. 
65          * Values are then taken from these arrays to local copies, that have names without
66          * _globalindex, in the routine make_local_gb(), which is called once for single
67          * node runs, and for DD at every call to dd_partition_system
68          */
69
70         real  *gpol;              /* Atomic polarisation energies */
71         real  *gpol_globalindex;  /*  */
72         real  *gpol_still_work;   /* Work array for Still model */
73         real  *gpol_hct_work;     /* Work array for HCT/OBC models */
74         real  *bRad;              /* Atomic Born radii */
75         real  *vsolv;             /* Atomic solvation volumes */
76         real  *vsolv_globalindex; /*  */
77         real  *gb_radius;          /* Radius info, copied from atomtypes */
78         real  *gb_radius_globalindex; 
79         
80         int  *use;                 /* Array that till if this atom does GB */   
81         int  *use_globalindex;     /* Global array for parallelization */
82                 
83         real es;                  /* Solvation energy and derivatives */
84         real *asurf;              /* Atomic surface area */
85         rvec *dasurf;             /* Surface area derivatives */
86         real as;                  /* Total surface area */
87
88         real *drobc;              /* Parameters for OBC chain rule calculation */
89         real *param;              /* Precomputed factor rai*atype->S_hct for HCT/OBC */
90         real *param_globalindex;  /*  */
91         
92         real *log_table;          /* Table for logarithm lookup */
93         
94         real obc_alpha;           /* OBC parameters */
95         real obc_beta;            /* OBC parameters */
96         real obc_gamma;           /* OBC parameters */
97         real gb_doffset;          /* Dielectric offset for Still/HCT/OBC */
98         real gb_epsilon_solvent;  /*   */
99         real epsilon_r;           /* Used for inner dielectric */
100   
101   real sa_surface_tension;  /* Surface tension for non-polar solvation */
102         
103         real *work;               /* Used for parallel summation and in the chain rule, length natoms         */
104         real *buf;                /* Used for parallel summation and in the chain rule, length natoms         */
105         int  *count;              /* Used for setting up the special gb nblist, length natoms                 */
106         gbtmpnbls_t nblist_work;  /* Used for setting up the special gb nblist, dim natoms*nblist_work_nalloc */
107         int  nblist_work_nalloc;  /* Length of second dimension of nblist_work                                */
108
109 gmx_genborn_t;
110
111 #ifdef __cplusplus
112 }
113 #endif
114