Fixing copyright issues and code contributors
[alexxy/gromacs.git] / include / types / nblist.h
1 /*
2  * This file is part of the GROMACS molecular simulation package.
3  *
4  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
5  * Copyright (c) 2001-2004, The GROMACS development team,
6  * check out http://www.gromacs.org for more information.
7  * Copyright (c) 2012,2013, by the GROMACS development team, led by
8  * David van der Spoel, Berk Hess, Erik Lindahl, and including many
9  * others, as listed in the AUTHORS file in the top-level source
10  * directory and at http://www.gromacs.org.
11  *
12  * GROMACS is free software; you can redistribute it and/or
13  * modify it under the terms of the GNU Lesser General Public License
14  * as published by the Free Software Foundation; either version 2.1
15  * of the License, or (at your option) any later version.
16  *
17  * GROMACS is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
20  * Lesser General Public License for more details.
21  *
22  * You should have received a copy of the GNU Lesser General Public
23  * License along with GROMACS; if not, see
24  * http://www.gnu.org/licenses, or write to the Free Software Foundation,
25  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
26  *
27  * If you want to redistribute modifications to GROMACS, please
28  * consider that scientific software is very special. Version
29  * control is crucial - bugs must be traceable. We will be happy to
30  * consider code for inclusion in the official distribution, but
31  * derived work must not be called official GROMACS. Details are found
32  * in the README & COPYING files - if they are missing, get the
33  * official version at http://www.gromacs.org.
34  *
35  * To help us fund GROMACS development, we humbly ask that you cite
36  * the research papers on the package. Check out http://www.gromacs.org.
37  */
38 #ifndef _nblist_h
39 #define _nblist_h
40
41 #ifdef __cplusplus
42 extern "C" {
43 #endif
44
45
46 typedef unsigned long t_excl;
47
48 /* The maximum charge group size because of minimum size of t_excl
49  * could be 32 bits.
50  */
51 #define MAX_CHARGEGROUP_SIZE 32
52
53 /* The maximum charge group size for CG-CG nblists.
54  * The excl entry in t_nblist uses blocks of this size.
55  */
56 #define MAX_CGCGSIZE 32
57
58 typedef struct 
59 {
60     int             igeometry;    /* The type of list (atom, water, etc.)  */
61     int             ielec;        /* Coulomb loop type index for kernels   */
62     int             ielecmod;     /* Coulomb modifier (e.g. switch/shift)  */
63     int             ivdw;         /* VdW loop type index for kernels       */
64     int             ivdwmod;      /* VdW modifier (e.g. switch/shift)      */
65     int             type;         /* Type of interaction, listed in
66                                      gmx_nblist_interaction_type           */
67
68     int             nri,maxnri;   /* Current/max number of i particles     */
69     int             nrj,maxnrj;   /* Current/max number of j particles     */
70     int             maxlen;       /* maxnr of j atoms for a single i atom  */
71     int *           iinr;         /* The i-elements                        */
72     int *           iinr_end;     /* The end atom, only with enlistCG      */
73     int *           gid;          /* Index in energy arrays                */
74     int *           shift;        /* Shift vector index                    */
75     int *           jindex;       /* Index in jjnr                         */
76     int *           jjnr;         /* The j-atom list                       */
77     int *           jjnr_end;     /* The end atom, only with enltypeCG     */
78     t_excl *        excl;         /* Exclusions, only with enltypeCG       */
79
80     /* We use separate pointers for kernels that compute both potential
81      * and force (vf suffix), only potential (v) or only force (f)
82      */
83     void *          kernelptr_vf;
84     void *          kernelptr_v;
85     void *          kernelptr_f;
86
87     /* Pad the list of neighbors for each i atom with "-1" entries up to the
88      * simd_padding_width, if it is larger than 0. This is necessary for many
89      * accelerated kernels using single-instruction multiple-data operations
90      * internally.
91      */
92     int             simd_padding_width;
93
94 } t_nblist;
95
96
97 /* For atom I =  nblist->iinr[N] (0 <= N < nblist->nri) there can be
98  * several neighborlists (N's), for different energy groups (gid) and
99  * different shifts (shift).
100  * For corresponding J atoms for each list start at:
101  * nblist->jjnr[JI]
102  * with nblist->jindex[N] <= JI < nblist->jindex[N+1]
103  *
104  * enlist is of the form enlistUNIT1_UNIT2:
105  * UNIT ATOM:  there is one atom: iinr[N] or jjnr[JI]
106  * UNIT SPC:   there are 3 atoms: iinr[N],iinr[N]+1,iinr[N]+2, jjnr analog.
107  * UNIT TIP4P: there are 4 atoms: iinr[N],...,iinr[N]+3, jjnr analog.
108  * UNIT CG:    there are N atoms: iinr[N],...,iinr_end[N]-1, jjnr analog.
109  *
110  * Clear?
111  */
112
113 #ifdef __cplusplus
114 }
115 #endif
116
117 #endif