2 * This file is part of the GROMACS molecular simulation package.
4 * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
5 * Copyright (c) 2001-2008, The GROMACS development team.
6 * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
7 * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
8 * and including many others, as listed in the AUTHORS file in the
9 * top-level source directory and at http://www.gromacs.org.
11 * GROMACS is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU Lesser General Public License
13 * as published by the Free Software Foundation; either version 2.1
14 * of the License, or (at your option) any later version.
16 * GROMACS is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * Lesser General Public License for more details.
21 * You should have received a copy of the GNU Lesser General Public
22 * License along with GROMACS; if not, see
23 * http://www.gnu.org/licenses, or write to the Free Software Foundation,
24 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
26 * If you want to redistribute modifications to GROMACS, please
27 * consider that scientific software is very special. Version
28 * control is crucial - bugs must be traceable. We will be happy to
29 * consider code for inclusion in the official distribution, but
30 * derived work must not be called official GROMACS. Details are found
31 * in the README & COPYING files - if they are missing, get the
32 * official version at http://www.gromacs.org.
34 * To help us fund GROMACS development, we humbly ask that you cite
35 * the research papers on the package. Check out http://www.gromacs.org.
37 #ifndef GMX_MDLIB_GENBORN_H
38 #define GMX_MDLIB_GENBORN_H
40 #include "gromacs/math/utilities.h"
41 #include "gromacs/math/vectypes.h"
44 struct gmx_enerdata_t
;
45 struct gmx_localtop_t
;
64 typedef struct gbtmpnbls
*gbtmpnbls_t
;
66 /* Struct to hold all the information for GB */
67 typedef struct gmx_genborn_t
69 int nr
; /* number of atoms, length of arrays below */
70 int n12
; /* number of 1-2 (bond) interactions */
71 int n13
; /* number of 1-3 (angle) terms */
72 int n14
; /* number of 1-4 (torsion) terms */
73 int nalloc
; /* Allocation of local arrays (with DD) */
76 /* Arrays below that end with _globalindex are used for setting up initial values of
77 * all gb parameters and values. They all have length natoms, which for DD is the
79 * Values are then taken from these arrays to local copies, that have names without
80 * _globalindex, in the routine make_local_gb(), which is called once for single
81 * node runs, and for DD at every call to dd_partition_system
84 real
*gpol
; /* Atomic polarisation energies */
85 real
*gpol_globalindex
; /* */
86 real
*gpol_still_work
; /* Work array for Still model */
87 real
*gpol_hct_work
; /* Work array for HCT/OBC models */
88 real
*bRad
; /* Atomic Born radii */
89 real
*vsolv
; /* Atomic solvation volumes */
90 real
*vsolv_globalindex
; /* */
91 real
*gb_radius
; /* Radius info, copied from atomtypes */
92 real
*gb_radius_globalindex
;
94 int *use
; /* Array that till if this atom does GB */
95 int *use_globalindex
; /* Global array for parallelization */
97 real es
; /* Solvation energy and derivatives */
98 real
*asurf
; /* Atomic surface area */
99 rvec
*dasurf
; /* Surface area derivatives */
100 real as
; /* Total surface area */
102 real
*drobc
; /* Parameters for OBC chain rule calculation */
103 real
*param
; /* Precomputed factor rai*atype->S_hct for HCT/OBC */
104 real
*param_globalindex
; /* */
106 real
*log_table
; /* Table for logarithm lookup */
108 real obc_alpha
; /* OBC parameters */
109 real obc_beta
; /* OBC parameters */
110 real obc_gamma
; /* OBC parameters */
111 real gb_doffset
; /* Dielectric offset for Still/HCT/OBC */
112 real gb_epsilon_solvent
; /* */
113 real epsilon_r
; /* Used for inner dielectric */
115 real sa_surface_tension
; /* Surface tension for non-polar solvation */
117 real
*work
; /* Used for parallel summation and in the chain rule, length natoms */
118 real
*buf
; /* Used for parallel summation and in the chain rule, length natoms */
119 int *count
; /* Used for setting up the special gb nblist, length natoms */
120 gbtmpnbls_t nblist_work
; /* Used for setting up the special gb nblist, dim natoms*nblist_work_nalloc */
121 int nblist_work_nalloc
; /* Length of second dimension of nblist_work */
124 /* Still parameters - make sure to edit in genborn_sse.c too if you change these! */
125 #define STILL_P1 0.073*0.1 /* length */
126 #define STILL_P2 0.921*0.1*CAL2JOULE /* energy*length */
127 #define STILL_P3 6.211*0.1*CAL2JOULE /* energy*length */
128 #define STILL_P4 15.236*0.1*CAL2JOULE
129 #define STILL_P5 1.254
131 #define STILL_P5INV (1.0/STILL_P5)
132 #define STILL_PIP5 (M_PI*STILL_P5)
135 /* Initialise GB stuff */
136 int init_gb(struct gmx_genborn_t
**p_born
,
137 struct t_forcerec
*fr
, const struct t_inputrec
*ir
,
138 const gmx_mtop_t
*mtop
, int gb_algorithm
);
141 /* Born radii calculations, both with and without SSE acceleration */
142 int calc_gb_rad(struct t_commrec
*cr
, struct t_forcerec
*fr
, struct t_inputrec
*ir
, gmx_localtop_t
*top
, rvec x
[], t_nblist
*nl
, struct gmx_genborn_t
*born
, t_mdatoms
*md
, t_nrnb
*nrnb
);
146 /* Bonded GB interactions */
147 real
gb_bonds_tab(rvec x
[], rvec f
[], rvec fshift
[], real
*charge
, real
*p_gbtabscale
,
148 real
*invsqrta
, real
*dvda
, real
*GBtab
, t_idef
*idef
, real epsilon_r
,
149 real gb_epsilon_solvent
, real facel
, const struct t_pbc
*pbc
,
150 const struct t_graph
*graph
);
155 /* Functions for calculating adjustments due to ie chain rule terms */
157 calc_gb_forces(struct t_commrec
*cr
, t_mdatoms
*md
, struct gmx_genborn_t
*born
, gmx_localtop_t
*top
,
158 rvec x
[], rvec f
[], struct t_forcerec
*fr
, t_idef
*idef
, int gb_algorithm
, int sa_algorithm
, t_nrnb
*nrnb
,
159 const struct t_pbc
*pbc
, const struct t_graph
*graph
, struct gmx_enerdata_t
*enerd
);
163 make_gb_nblist(struct t_commrec
*cr
, int gb_algorithm
,
164 rvec x
[], matrix box
,
165 struct t_forcerec
*fr
, t_idef
*idef
, struct t_graph
*graph
, struct gmx_genborn_t
*born
);
168 make_local_gb(const struct t_commrec
*cr
, struct gmx_genborn_t
*born
, int gb_algorithm
);