Improve use of gmxpreprocess headers
[alexxy/gromacs.git] / src / gromacs / gmxpreprocess / grompp-impl.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  * Copyright (c) 2013,2014,2015,2016,2018,2019, 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.
10  *
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.
15  *
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.
20  *
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.
25  *
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.
33  *
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.
36  */
37
38 #ifndef GMX_GMXPREPROCESS_GROMPP_IMPL_H
39 #define GMX_GMXPREPROCESS_GROMPP_IMPL_H
40
41 #include "gromacs/topology/atoms.h"
42 #include "gromacs/topology/block.h"
43 #include "gromacs/topology/idef.h"
44 #include "gromacs/utility/basedefinitions.h"
45 #include "gromacs/utility/real.h"
46
47 #define MAXSLEN 32
48
49 struct t_param
50 {
51     int        a[MAXATOMLIST];   /* The atom list (eg. bonds: particle  */
52     /* i = a[0] (ai), j = a[1] (aj))    */
53     real       c[MAXFORCEPARAM]; /* Force parameters (eg. b0 = c[0])    */
54     char       s[MAXSLEN];       /* A string (instead of parameters),    *
55                                   * read from the .rtp file in pdb2gmx   */
56     const int &ai() const { return a[0]; }
57     int       &ai() { return a[0]; }
58     const int &aj() const { return a[1]; }
59     int       &aj() { return a[1]; }
60     const int &ak() const { return a[2]; }
61     int       &ak() { return a[2]; }
62     const int &al() const { return a[3]; }
63     int       &al() { return a[3]; }
64     const int &am() const { return a[4]; }
65     int       &am() { return a[4]; }
66
67     real      &c0() { return c[0]; }
68     real      &c1() { return c[1]; }
69     real      &c2() { return c[2]; }
70 };
71
72 struct t_params
73 {                       // NOLINT (clang-analyzer-optin.performance.Padding)
74     int          nr;    /* The number of bonds in this record   */
75     int          maxnr; /* The amount of elements in the array  */
76     t_param     *param; /* Array of parameters (dim: nr or nr*nr) */
77
78     /* CMAP tmp data, there are probably better places for this */
79     int         grid_spacing; /* Cmap grid spacing */
80     int         nc;           /* Number of cmap angles */
81
82     real       *cmap;         /* Temporary storage of the raw cmap grid data */
83     int         ncmap;        /* Number of allocated elements in cmap grid*/
84
85     int        *cmap_types;   /* Store the five atomtypes followed by a number that identifies the type */
86     int         nct;          /* Number of allocated elements in cmap_types */
87 };
88
89 struct t_excls
90 {
91     int            nr;      /* The number of exclusions             */
92     int           *e;       /* The excluded atoms                   */
93 };
94
95 struct t_molinfo
96 {
97     char            **name;
98     int               nrexcl;       /* Number of exclusions per atom    */
99     bool              excl_set;     /* Have exclusions been generated?  */
100     bool              bProcessed;   /* Has the mol been processed           */
101     t_atoms           atoms;        /* Atoms                                */
102     t_block           cgs;          /* Charge groups                        */
103     t_block           mols;         /* Molecules                            */
104     t_blocka          excls;        /* Exclusions                           */
105     t_params          plist[F_NRE]; /* Parameters in old style              */
106 };
107
108 struct t_mols
109 {
110     char *name;
111     int   nr;
112 };
113
114 bool is_int(double x);
115 /* Returns TRUE when x is integer */
116
117 #endif