change math const from M_ to MY_ using math_const.h

This commit is contained in:
Colin Denniston
2022-03-10 12:36:41 -05:00
parent 5bf1ab0e2d
commit 12b144fd0e
3 changed files with 6 additions and 8 deletions

View File

@ -31,9 +31,6 @@
#include "random_mars.h"
#include "update.h"
#include <cfloat>
#ifndef _USE_MATH_DEFINES // needed for compilation under windows
#define _USE_MATH_DEFINES
#endif
#include <cmath>
#include <cstring>
#include <fstream>

View File

@ -21,11 +21,11 @@ FixStyle(lb/fluid,FixLbFluid)
#define LMP_FIX_LB_FLUID_H
#include "fix.h"
#include "math_const.h"
using LAMMPS_NS::MathConst::MY_SQRT2;
using LAMMPS_NS::MathConst::MY_SQRT1_2;
#ifndef _USE_MATH_DEFINES // needed for compilation under windows
#define _USE_MATH_DEFINES
#endif
#include <cmath>
#if defined(MPI_STUBS)
#error "The LATBOLTZ package cannot be compiled in serial with MPI STUBS"
@ -66,7 +66,7 @@ static const double mg_lb15[15][15] = {
{ 0., 0., 0., 0., 0., -1./3., 1./3., 2./3., 2./3., 2./3., 2./3., -2./3., -2./3., -2./3., -2./3.},
{ 0., -1./3., 0., 1./3., 0., 0., 0., 2./3., -2./3., -2./3., 2./3., 2./3., -2./3., -2./3., 2./3.},
{ 0., 0., 0., 0., 0., 0., 0., 1., -1., 1., -1., -1., 1., -1., 1.},
{M_SQRT2,-M_SQRT1_2,-M_SQRT1_2,-M_SQRT1_2,-M_SQRT1_2,-M_SQRT1_2,-M_SQRT1_2,M_SQRT2,M_SQRT2,M_SQRT2,M_SQRT2,M_SQRT2,M_SQRT2,M_SQRT2,M_SQRT2}
{MY_SQRT2,-MY_SQRT1_2,-MY_SQRT1_2,-MY_SQRT1_2,-MY_SQRT1_2,-MY_SQRT1_2,-MY_SQRT1_2,MY_SQRT2,MY_SQRT2,MY_SQRT2,MY_SQRT2,MY_SQRT2,MY_SQRT2,MY_SQRT2,MY_SQRT2}
};
// clang-format on

View File

@ -29,6 +29,7 @@ namespace MathConst {
static constexpr double MY_ISPI4 = 1.12837916709551257389; // 1/sqrt(pi/4)
static constexpr double MY_SQRT2 = 1.41421356237309504880; // sqrt(2)
static constexpr double MY_CUBEROOT2 = 1.25992104989487316476; // 2*(1/3)
static constexpr double MY_SQRT1_2 = 0.707106781186547524401; // 1/sqrt(2)
} // namespace MathConst
} // namespace LAMMPS_NS