Code beautification with uncrustify
[alexxy/gromacs.git] / src / gromacs / legacyheaders / types / nblist.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  *                        VERSION 3.2.0
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-2004, 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  * GRoups of Organic Molecules in ACtion for Science
34  */
35 #ifndef _nblist_h
36 #define _nblist_h
37
38 #ifdef __cplusplus
39 extern "C" {
40 #endif
41
42
43 typedef unsigned long t_excl;
44
45 /* The maximum charge group size because of minimum size of t_excl
46  * could be 32 bits.
47  */
48 #define MAX_CHARGEGROUP_SIZE 32
49
50 /* The maximum charge group size for CG-CG nblists.
51  * The excl entry in t_nblist uses blocks of this size.
52  */
53 #define MAX_CGCGSIZE 32
54
55 typedef struct
56 {
57     int             igeometry;    /* The type of list (atom, water, etc.)  */
58     int             ielec;        /* Coulomb loop type index for kernels   */
59     int             ielecmod;     /* Coulomb modifier (e.g. switch/shift)  */
60     int             ivdw;         /* VdW loop type index for kernels       */
61     int             ivdwmod;      /* VdW modifier (e.g. switch/shift)      */
62     int             type;         /* Type of interaction, listed in
63                                      gmx_nblist_interaction_type           */
64
65     int             nri, maxnri;  /* Current/max number of i particles     */
66     int             nrj, maxnrj;  /* Current/max number of j particles     */
67     int             maxlen;       /* maxnr of j atoms for a single i atom  */
68     int *           iinr;         /* The i-elements                        */
69     int *           iinr_end;     /* The end atom, only with enlistCG      */
70     int *           gid;          /* Index in energy arrays                */
71     int *           shift;        /* Shift vector index                    */
72     int *           jindex;       /* Index in jjnr                         */
73     int *           jjnr;         /* The j-atom list                       */
74     int *           jjnr_end;     /* The end atom, only with enltypeCG     */
75     t_excl *        excl;         /* Exclusions, only with enltypeCG       */
76
77     /* We use separate pointers for kernels that compute both potential
78      * and force (vf suffix), only potential (v) or only force (f)
79      */
80     void *          kernelptr_vf;
81     void *          kernelptr_v;
82     void *          kernelptr_f;
83
84     /* Pad the list of neighbors for each i atom with "-1" entries up to the
85      * simd_padding_width, if it is larger than 0. This is necessary for many
86      * accelerated kernels using single-instruction multiple-data operations
87      * internally.
88      */
89     int             simd_padding_width;
90
91 } t_nblist;
92
93
94 /* For atom I =  nblist->iinr[N] (0 <= N < nblist->nri) there can be
95  * several neighborlists (N's), for different energy groups (gid) and
96  * different shifts (shift).
97  * For corresponding J atoms for each list start at:
98  * nblist->jjnr[JI]
99  * with nblist->jindex[N] <= JI < nblist->jindex[N+1]
100  *
101  * enlist is of the form enlistUNIT1_UNIT2:
102  * UNIT ATOM:  there is one atom: iinr[N] or jjnr[JI]
103  * UNIT SPC:   there are 3 atoms: iinr[N],iinr[N]+1,iinr[N]+2, jjnr analog.
104  * UNIT TIP4P: there are 4 atoms: iinr[N],...,iinr[N]+3, jjnr analog.
105  * UNIT CG:    there are N atoms: iinr[N],...,iinr_end[N]-1, jjnr analog.
106  *
107  * Clear?
108  */
109
110 #ifdef __cplusplus
111 }
112 #endif
113
114 #endif