Use constexpr for physical constants and move them into gmx namespace
[alexxy/gromacs.git] / src / gromacs / gmxpreprocess / topshake.cpp
index acea8377c56e47ced99124548949c47acf12ed43..f26e044453d71459fd7fbe05453fbf5d39496fcd 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2018,2019,2020, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2018,2019,2020,2021, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -162,9 +162,9 @@ void make_shake(gmx::ArrayRef<InteractionsOfType> plist, t_atoms* atoms, int nsh
                                     }
                                     if (bFound)
                                     {
-                                        real param = std::sqrt(b_ij * b_ij + b_jk * b_jk
-                                                               - 2.0 * b_ij * b_jk
-                                                                         * cos(DEG2RAD * ang->c0()));
+                                        real param = std::sqrt(
+                                                b_ij * b_ij + b_jk * b_jk
+                                                - 2.0 * b_ij * b_jk * cos(gmx::c_deg2Rad * ang->c0()));
                                         std::vector<real> forceParm = { param, param };
                                         if (ftype == F_CONNBONDS || ftype_a == F_CONNBONDS)
                                         {