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