2 * This file is part of the GROMACS molecular simulation package.
4 * Copyright (c) 2020,2021, by the GROMACS development team, led by
5 * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
6 * and including many others, as listed in the AUTHORS file in the
7 * top-level source directory and at http://www.gromacs.org.
9 * GROMACS is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public License
11 * as published by the Free Software Foundation; either version 2.1
12 * of the License, or (at your option) any later version.
14 * GROMACS is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with GROMACS; if not, see
21 * http://www.gnu.org/licenses, or write to the Free Software Foundation,
22 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24 * If you want to redistribute modifications to GROMACS, please
25 * consider that scientific software is very special. Version
26 * control is crucial - bugs must be traceable. We will be happy to
27 * consider code for inclusion in the official distribution, but
28 * derived work must not be called official GROMACS. Details are found
29 * in the README & COPYING files - if they are missing, get the
30 * official version at http://www.gromacs.org.
32 * To help us fund GROMACS development, we humbly ask that you cite
33 * the research papers on the package. Check out http://www.gromacs.org.
35 /*! \inpublicapi \file
37 * Implements some definitions that are identical to those of gromacs
39 * \author Victor Holanda <victor.holanda@cscs.ch>
40 * \author Joe Jordan <ejjordan@kth.se>
41 * \author Prashanth Kanduri <kanduri@cscs.ch>
42 * \author Sebastian Keller <keller@cscs.ch>
43 * \author Artem Zhmurov <zhmurov@gmail.com>
45 #ifndef NBLIB_BASICDEFINITIONS_H
46 #define NBLIB_BASICDEFINITIONS_H
50 // from utility/real.h
56 #else /* GMX_DOUBLE */
61 #endif /* GMX_DOUBLE */
69 constexpr const float KILO = 1e3; /* Thousand */
70 constexpr const double NANO = 1e-9; /* A Number */
71 constexpr const double E_CHARGE = 1.602176634e-19; /* Exact definition, Coulomb NIST 2018 CODATA */
72 constexpr const double BOLTZMANN = 1.380649e-23; /* (J/K, Exact definition, NIST 2018 CODATA */
73 constexpr const double AVOGADRO = 6.02214076e23; /* 1/mol, Exact definition, NIST 2018 CODATA */
74 constexpr const double RGAS = (BOLTZMANN * AVOGADRO); /* (J/(mol K)) */
75 constexpr const double EPSILON0_SI = 8.8541878128e-12; /* F/m, NIST 2018 CODATA */
76 constexpr const double EPSILON0 = ((EPSILON0_SI * NANO * KILO) / (E_CHARGE * E_CHARGE * AVOGADRO));
79 constexpr const int D_BOX_Z = 1;
80 constexpr const int D_BOX_Y = 1;
81 constexpr const int D_BOX_X = 2;
82 constexpr const int N_BOX_Z = (2 * D_BOX_Z + 1);
83 constexpr const int N_BOX_Y = (2 * D_BOX_Y + 1);
84 constexpr const int N_BOX_X = (2 * D_BOX_X + 1);
85 constexpr const int N_IVEC = (N_BOX_Z * N_BOX_Y * N_BOX_X);
88 //! Needed for generating Bolzmann velocity distribution (kJ/(mol K))
89 constexpr const real BOLTZ = (detail::RGAS / detail::KILO); /* */
92 //! Required work-around for platforms that don't implement POSIX-style cmath header
93 # define M_PI 3.14159265358979323846
96 //! Charge multiplication factor for Coulomb interactions
97 constexpr const real ONE_4PI_EPS0 = (1.0 / (4.0 * M_PI * detail::EPSILON0));
99 //! Conversion factor from degrees to radians
100 constexpr const real DEG2RAD = M_PI / 180.0;
102 //! The number of shift vectors needed for pbc
103 constexpr const int numShiftVectors = detail::N_IVEC;
105 // from math/vectypes.h
106 constexpr const int dimX = 0; /* Defines for indexing in vectors */
107 constexpr const int dimY = 1;
108 constexpr const int dimZ = 2;
110 constexpr const int dimSize = 3;
111 typedef real rvec[dimSize];
112 typedef real matrix[dimSize][dimSize];
116 #endif // NBLIB_BASICDEFINITIONS_H