From a6261d75b9fcbafff2ae0830f6bba57a99a22908 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 24 Jan 2024 20:42:14 -0500 Subject: [PATCH] some more define to static constexpr conversions --- src/DIELECTRIC/pppm_disp_dielectric.cpp | 8 ++++---- src/ELECTRODE/pppm_electrode.cpp | 8 ++++---- src/EXTRA-FIX/fix_tmd.cpp | 2 +- src/GPU/pppm_gpu.cpp | 8 ++++---- src/INTEL/pppm_disp_intel.cpp | 10 +++++----- src/INTEL/pppm_electrode_intel.cpp | 10 +++++----- src/INTEL/pppm_intel.cpp | 10 +++++----- src/KOKKOS/atom_map_kokkos.cpp | 2 +- src/KOKKOS/mliap_descriptor_so3_kokkos.cpp | 2 +- src/KOKKOS/pppm_kokkos.cpp | 8 ++++---- src/KSPACE/msm.cpp | 2 +- src/KSPACE/msm_cg.cpp | 2 +- src/KSPACE/pair_coul_streitz.cpp | 2 +- src/KSPACE/pppm.cpp | 8 ++++---- src/KSPACE/pppm_cg.cpp | 2 +- src/KSPACE/pppm_dipole.cpp | 8 ++++---- src/KSPACE/pppm_dipole_spin.cpp | 8 ++++---- src/KSPACE/pppm_disp.cpp | 8 ++++---- src/KSPACE/pppm_disp.h | 4 ++-- src/KSPACE/pppm_disp_tip4p.cpp | 2 +- src/KSPACE/pppm_stagger.cpp | 4 ++-- src/KSPACE/pppm_tip4p.cpp | 2 +- src/MANYBODY/pair_comb.cpp | 2 +- src/MANYBODY/pair_comb3.cpp | 2 +- src/MISC/pair_agni.cpp | 2 +- src/MOLECULE/pair_hbond_dreiding_lj.cpp | 2 +- src/MOLECULE/pair_hbond_dreiding_morse.cpp | 2 +- src/OPENMP/msm_cg_omp.cpp | 2 +- src/OPENMP/pair_comb_omp.cpp | 2 +- src/OPENMP/pppm_cg_omp.cpp | 2 +- src/OPENMP/pppm_disp_omp.cpp | 2 +- src/OPENMP/pppm_disp_tip4p_omp.cpp | 2 +- src/OPENMP/pppm_omp.cpp | 2 +- src/OPENMP/pppm_tip4p_omp.cpp | 4 ++-- src/QEQ/fix_qeq_fire.cpp | 2 +- src/REPLICA/fix_neb.cpp | 2 +- src/SMTBQ/pair_smtbq.cpp | 2 +- src/SPIN/fix_neb_spin.cpp | 2 +- src/SPIN/min_spin.cpp | 2 +- src/SPIN/min_spin_cg.cpp | 2 +- src/SPIN/min_spin_lbfgs.cpp | 2 +- src/angle_hybrid.cpp | 2 +- src/atom_map.cpp | 2 +- src/bond_hybrid.cpp | 2 +- src/dihedral_hybrid.cpp | 2 +- src/improper_hybrid.cpp | 2 +- src/min_quickmin.cpp | 2 +- src/read_dump.cpp | 2 +- src/variable.cpp | 2 +- 49 files changed, 88 insertions(+), 88 deletions(-) diff --git a/src/DIELECTRIC/pppm_disp_dielectric.cpp b/src/DIELECTRIC/pppm_disp_dielectric.cpp index 6e7e3faa8b..baa9478a45 100644 --- a/src/DIELECTRIC/pppm_disp_dielectric.cpp +++ b/src/DIELECTRIC/pppm_disp_dielectric.cpp @@ -33,11 +33,11 @@ using namespace LAMMPS_NS; using namespace MathConst; -#define MAXORDER 7 -#define OFFSET 16384 +static constexpr int MAXORDER = 7; +static constexpr int OFFSET = 16384; static constexpr double SMALL = 0.00001; -#define LARGE 10000.0 -#define EPS_HOC 1.0e-7 +static constexpr double LARGE = 10000.0; +static constexpr double EPS_HOC = 1.0e-7; enum{REVERSE_RHO,REVERSE_RHO_GEOM,REVERSE_RHO_ARITH,REVERSE_RHO_NONE}; enum{FORWARD_IK,FORWARD_AD,FORWARD_IK_PERATOM,FORWARD_AD_PERATOM, diff --git a/src/ELECTRODE/pppm_electrode.cpp b/src/ELECTRODE/pppm_electrode.cpp index 44d0c0c009..b9024cd69a 100644 --- a/src/ELECTRODE/pppm_electrode.cpp +++ b/src/ELECTRODE/pppm_electrode.cpp @@ -45,11 +45,11 @@ using namespace LAMMPS_NS; using namespace MathConst; using namespace MathSpecial; -#define MAXORDER 7 -#define OFFSET 16384 -#define LARGE 10000.0 +static constexpr int MAXORDER = 7; +static constexpr int OFFSET = 16384; +static constexpr double LARGE = 10000.0; static constexpr double SMALL = 0.00001; -#define EPS_HOC 1.0e-7 +static constexpr double EPS_HOC = 1.0e-7; enum { REVERSE_RHO }; enum { FORWARD_IK, FORWARD_AD, FORWARD_IK_PERATOM, FORWARD_AD_PERATOM }; diff --git a/src/EXTRA-FIX/fix_tmd.cpp b/src/EXTRA-FIX/fix_tmd.cpp index d96666fe50..401ed41573 100644 --- a/src/EXTRA-FIX/fix_tmd.cpp +++ b/src/EXTRA-FIX/fix_tmd.cpp @@ -36,7 +36,7 @@ using namespace LAMMPS_NS; using namespace FixConst; -#define CHUNK 1000 +static constexpr int CHUNK = 1000; static constexpr int MAXLINE = 256; /* ---------------------------------------------------------------------- */ diff --git a/src/GPU/pppm_gpu.cpp b/src/GPU/pppm_gpu.cpp index 6009d9d798..2c092f6a8e 100644 --- a/src/GPU/pppm_gpu.cpp +++ b/src/GPU/pppm_gpu.cpp @@ -40,11 +40,11 @@ using namespace LAMMPS_NS; using namespace MathConst; -#define MAXORDER 7 -#define OFFSET 16384 +static constexpr int MAXORDER = 7; +static constexpr int OFFSET = 16384; static constexpr double SMALL = 0.00001; -#define LARGE 10000.0 -#define EPS_HOC 1.0e-7 +static constexpr double LARGE = 10000.0; +static constexpr double EPS_HOC = 1.0e-7; enum{REVERSE_RHO_GPU,REVERSE_RHO}; enum{FORWARD_IK,FORWARD_AD,FORWARD_IK_PERATOM,FORWARD_AD_PERATOM}; diff --git a/src/INTEL/pppm_disp_intel.cpp b/src/INTEL/pppm_disp_intel.cpp index b482c9309e..b34123a348 100644 --- a/src/INTEL/pppm_disp_intel.cpp +++ b/src/INTEL/pppm_disp_intel.cpp @@ -39,11 +39,11 @@ using namespace LAMMPS_NS; using namespace MathConst; using namespace MathSpecial; -#define MAXORDER 7 -#define OFFSET 16384 -#define SMALL 0.00001 -#define LARGE 10000.0 -#define EPS_HOC 1.0e-7 +static constexpr int MAXORDER = 7; +static constexpr int OFFSET = 16384; +static constexpr double SMALL = 0.00001; +static constexpr double LARGE = 10000.0; +static constexpr double EPS_HOC = 1.0e-7; enum{GEOMETRIC,ARITHMETIC,SIXTHPOWER}; enum{REVERSE_RHO, REVERSE_RHO_G, REVERSE_RHO_A, REVERSE_RHO_NONE}; diff --git a/src/INTEL/pppm_electrode_intel.cpp b/src/INTEL/pppm_electrode_intel.cpp index c4d2b32c0a..9f3c57b50e 100644 --- a/src/INTEL/pppm_electrode_intel.cpp +++ b/src/INTEL/pppm_electrode_intel.cpp @@ -48,11 +48,11 @@ using namespace LAMMPS_NS; using namespace std; -#define MAXORDER 7 -#define OFFSET 16384 -#define LARGE 10000.0 -#define SMALL 0.00001 -#define EPS_HOC 1.0e-7 +static constexpr int MAXORDER = 7; +static constexpr int OFFSET = 16384; +static constexpr double LARGE = 10000.0; +static constexpr double SMALL = 0.00001; +static constexpr double EPS_HOC = 1.0e-7; enum { REVERSE_RHO }; enum { FORWARD_IK, FORWARD_AD, FORWARD_IK_PERATOM, FORWARD_AD_PERATOM }; diff --git a/src/INTEL/pppm_intel.cpp b/src/INTEL/pppm_intel.cpp index 6abfeb4127..85117283ac 100644 --- a/src/INTEL/pppm_intel.cpp +++ b/src/INTEL/pppm_intel.cpp @@ -41,11 +41,11 @@ using namespace LAMMPS_NS; using namespace MathConst; using namespace MathSpecial; -#define MAXORDER 7 -#define OFFSET 16384 -#define LARGE 10000.0 -#define SMALL 0.00001 -#define EPS_HOC 1.0e-7 +static constexpr int MAXORDER = 7; +static constexpr int OFFSET = 16384; +static constexpr double LARGE = 10000.0; +static constexpr double SMALL = 0.00001; +static constexpr double EPS_HOC = 1.0e-7; enum{REVERSE_RHO}; enum{FORWARD_IK,FORWARD_AD,FORWARD_IK_PERATOM,FORWARD_AD_PERATOM}; diff --git a/src/KOKKOS/atom_map_kokkos.cpp b/src/KOKKOS/atom_map_kokkos.cpp index 4f46c33dbe..828eb7edea 100644 --- a/src/KOKKOS/atom_map_kokkos.cpp +++ b/src/KOKKOS/atom_map_kokkos.cpp @@ -25,7 +25,7 @@ using namespace LAMMPS_NS; -#define EXTRA 1000 +static constexpr int EXTRA = 1000; /* ---------------------------------------------------------------------- allocate and initialize array or hash table for global -> local map diff --git a/src/KOKKOS/mliap_descriptor_so3_kokkos.cpp b/src/KOKKOS/mliap_descriptor_so3_kokkos.cpp index 6a9f62457f..b079b734e0 100644 --- a/src/KOKKOS/mliap_descriptor_so3_kokkos.cpp +++ b/src/KOKKOS/mliap_descriptor_so3_kokkos.cpp @@ -32,7 +32,7 @@ using namespace LAMMPS_NS; static constexpr int MAXLINE = 1024; -#define MAXWORD 3 +static constexpr int MAXWORD = 3; /* ---------------------------------------------------------------------- */ template diff --git a/src/KOKKOS/pppm_kokkos.cpp b/src/KOKKOS/pppm_kokkos.cpp index 8e1629a136..4a253c5779 100644 --- a/src/KOKKOS/pppm_kokkos.cpp +++ b/src/KOKKOS/pppm_kokkos.cpp @@ -39,11 +39,11 @@ using namespace LAMMPS_NS; using namespace MathConst; using namespace MathSpecialKokkos; -#define MAXORDER 7 -#define OFFSET 16384 -#define LARGE 10000.0 +static constexpr int MAXORDER = 7; +static constexpr int OFFSET = 16384; +static constexpr double LARGE = 10000.0; static constexpr double SMALL = 0.00001; -#define EPS_HOC 1.0e-7 +static constexpr double EPS_HOC = 1.0e-7; enum{REVERSE_RHO}; enum{FORWARD_IK,FORWARD_IK_PERATOM}; diff --git a/src/KSPACE/msm.cpp b/src/KSPACE/msm.cpp index 56b09962d1..8f79ab408c 100644 --- a/src/KSPACE/msm.cpp +++ b/src/KSPACE/msm.cpp @@ -37,7 +37,7 @@ using namespace LAMMPS_NS; using namespace MathConst; #define MAX_LEVELS 10 -#define OFFSET 16384 +static constexpr int OFFSET = 16384; static constexpr double SMALL = 0.00001; enum{REVERSE_RHO,REVERSE_AD,REVERSE_AD_PERATOM}; diff --git a/src/KSPACE/msm_cg.cpp b/src/KSPACE/msm_cg.cpp index ec2f46d262..e680c05cb2 100644 --- a/src/KSPACE/msm_cg.cpp +++ b/src/KSPACE/msm_cg.cpp @@ -31,7 +31,7 @@ using namespace LAMMPS_NS; -#define OFFSET 16384 +static constexpr int OFFSET = 16384; static constexpr double SMALLQ = 0.00001; enum{REVERSE_RHO,REVERSE_AD,REVERSE_AD_PERATOM}; diff --git a/src/KSPACE/pair_coul_streitz.cpp b/src/KSPACE/pair_coul_streitz.cpp index 6d79a7d8de..9e3811c027 100644 --- a/src/KSPACE/pair_coul_streitz.cpp +++ b/src/KSPACE/pair_coul_streitz.cpp @@ -37,7 +37,7 @@ using namespace MathConst; static constexpr int DELTA = 4; static constexpr int PGDELTA = 1; -#define MAXNEIGH 24 +static constexpr int MAXNEIGH = 24; /* ---------------------------------------------------------------------- */ diff --git a/src/KSPACE/pppm.cpp b/src/KSPACE/pppm.cpp index 99dc3e27ba..0ac83c01fb 100644 --- a/src/KSPACE/pppm.cpp +++ b/src/KSPACE/pppm.cpp @@ -45,11 +45,11 @@ using namespace LAMMPS_NS; using namespace MathConst; using namespace MathSpecial; -#define MAXORDER 7 -#define OFFSET 16384 -#define LARGE 10000.0 +static constexpr int MAXORDER = 7; +static constexpr int OFFSET = 16384; +static constexpr double LARGE = 10000.0; static constexpr double SMALL = 0.00001; -#define EPS_HOC 1.0e-7 +static constexpr double EPS_HOC = 1.0e-7; enum{REVERSE_RHO}; enum{FORWARD_IK,FORWARD_AD,FORWARD_IK_PERATOM,FORWARD_AD_PERATOM}; diff --git a/src/KSPACE/pppm_cg.cpp b/src/KSPACE/pppm_cg.cpp index 1ae835fb1c..e5ae0b05c8 100644 --- a/src/KSPACE/pppm_cg.cpp +++ b/src/KSPACE/pppm_cg.cpp @@ -34,7 +34,7 @@ using namespace LAMMPS_NS; using namespace MathConst; -#define OFFSET 16384 +static constexpr int OFFSET = 16384; static constexpr double SMALLQ = 0.00001; enum{REVERSE_RHO}; diff --git a/src/KSPACE/pppm_dipole.cpp b/src/KSPACE/pppm_dipole.cpp index 4a8e91df8c..da64f85f9e 100644 --- a/src/KSPACE/pppm_dipole.cpp +++ b/src/KSPACE/pppm_dipole.cpp @@ -40,11 +40,11 @@ using namespace LAMMPS_NS; using namespace MathConst; using namespace MathSpecial; -#define MAXORDER 7 -#define OFFSET 16384 -#define LARGE 10000.0 +static constexpr int MAXORDER = 7; +static constexpr int OFFSET = 16384; +static constexpr double LARGE = 10000.0; static constexpr double SMALL = 0.00001; -#define EPS_HOC 1.0e-7 +static constexpr double EPS_HOC = 1.0e-7; enum{REVERSE_MU}; enum{FORWARD_MU,FORWARD_MU_PERATOM}; diff --git a/src/KSPACE/pppm_dipole_spin.cpp b/src/KSPACE/pppm_dipole_spin.cpp index 7a18531a64..16b9e459e6 100644 --- a/src/KSPACE/pppm_dipole_spin.cpp +++ b/src/KSPACE/pppm_dipole_spin.cpp @@ -35,11 +35,11 @@ using namespace LAMMPS_NS; using namespace MathConst; -#define MAXORDER 7 -#define OFFSET 16384 -#define LARGE 10000.0 +static constexpr int MAXORDER = 7; +static constexpr int OFFSET = 16384; +static constexpr double LARGE = 10000.0; static constexpr double SMALL = 0.00001; -#define EPS_HOC 1.0e-7 +static constexpr double EPS_HOC = 1.0e-7; enum{REVERSE_MU}; enum{FORWARD_MU,FORWARD_MU_PERATOM}; diff --git a/src/KSPACE/pppm_disp.cpp b/src/KSPACE/pppm_disp.cpp index 42e48325dc..58c91ce3be 100644 --- a/src/KSPACE/pppm_disp.cpp +++ b/src/KSPACE/pppm_disp.cpp @@ -40,11 +40,11 @@ using namespace LAMMPS_NS; using namespace MathConst; -#define MAXORDER 7 -#define OFFSET 16384 +static constexpr int MAXORDER = 7; +static constexpr int OFFSET = 16384; static constexpr double SMALL = 0.00001; -#define LARGE 10000.0 -#define EPS_HOC 1.0e-7 +static constexpr double LARGE = 10000.0; +static constexpr double EPS_HOC = 1.0e-7; enum{REVERSE_RHO,REVERSE_RHO_GEOM,REVERSE_RHO_ARITH,REVERSE_RHO_NONE}; enum{FORWARD_IK,FORWARD_AD,FORWARD_IK_PERATOM,FORWARD_AD_PERATOM, diff --git a/src/KSPACE/pppm_disp.h b/src/KSPACE/pppm_disp.h index a222e041d9..1a271e59d2 100644 --- a/src/KSPACE/pppm_disp.h +++ b/src/KSPACE/pppm_disp.h @@ -25,8 +25,8 @@ KSpaceStyle(pppm/disp,PPPMDisp); namespace LAMMPS_NS { -#define EWALD_MAXORDER 6 -#define EWALD_FUNCS 4 +static constexpr int EWALD_MAXORDER = 6; +static constexpr int EWALD_FUNCS = 4; class PPPMDisp : public KSpace { public: diff --git a/src/KSPACE/pppm_disp_tip4p.cpp b/src/KSPACE/pppm_disp_tip4p.cpp index d8aaa7a7e3..6161ebbe09 100644 --- a/src/KSPACE/pppm_disp_tip4p.cpp +++ b/src/KSPACE/pppm_disp_tip4p.cpp @@ -29,7 +29,7 @@ using namespace LAMMPS_NS; using namespace MathConst; -#define OFFSET 16384 +static constexpr int OFFSET = 16384; static constexpr FFT_SCALAR ZEROF = 0.0; static constexpr FFT_SCALAR ONEF = 1.0; diff --git a/src/KSPACE/pppm_stagger.cpp b/src/KSPACE/pppm_stagger.cpp index ef6c570cff..a14d7a68d6 100644 --- a/src/KSPACE/pppm_stagger.cpp +++ b/src/KSPACE/pppm_stagger.cpp @@ -33,8 +33,8 @@ using namespace LAMMPS_NS; using namespace MathConst; using namespace MathSpecial; -#define OFFSET 16384 -#define EPS_HOC 1.0e-7 +static constexpr int OFFSET = 16384; +static constexpr double EPS_HOC = 1.0e-7; enum{REVERSE_RHO}; enum{FORWARD_IK,FORWARD_AD,FORWARD_IK_PERATOM,FORWARD_AD_PERATOM}; diff --git a/src/KSPACE/pppm_tip4p.cpp b/src/KSPACE/pppm_tip4p.cpp index 8c85cea8b5..7237bc24f2 100644 --- a/src/KSPACE/pppm_tip4p.cpp +++ b/src/KSPACE/pppm_tip4p.cpp @@ -31,7 +31,7 @@ using namespace MathConst; static constexpr FFT_SCALAR ZEROF = 0.0; static constexpr FFT_SCALAR ONEF = 1.0; -#define OFFSET 16384 +static constexpr int OFFSET = 16384; /* ---------------------------------------------------------------------- */ diff --git a/src/MANYBODY/pair_comb.cpp b/src/MANYBODY/pair_comb.cpp index 0fa38474ee..37e3bb404f 100644 --- a/src/MANYBODY/pair_comb.cpp +++ b/src/MANYBODY/pair_comb.cpp @@ -45,7 +45,7 @@ using namespace MathSpecial; static constexpr int DELTA = 4; static constexpr int PGDELTA = 1; -#define MAXNEIGH 24 +static constexpr int MAXNEIGH = 24; /* ---------------------------------------------------------------------- */ diff --git a/src/MANYBODY/pair_comb3.cpp b/src/MANYBODY/pair_comb3.cpp index f98cc43608..5ae599ea31 100644 --- a/src/MANYBODY/pair_comb3.cpp +++ b/src/MANYBODY/pair_comb3.cpp @@ -45,7 +45,7 @@ using namespace MathSpecial; static constexpr int DELTA = 4; static constexpr int PGDELTA = 1; -#define MAXNEIGH 24 +static constexpr int MAXNEIGH = 24; /* ---------------------------------------------------------------------- */ diff --git a/src/MISC/pair_agni.cpp b/src/MISC/pair_agni.cpp index 79a3c03fb4..92b358316f 100644 --- a/src/MISC/pair_agni.cpp +++ b/src/MISC/pair_agni.cpp @@ -48,7 +48,7 @@ static const char cite_pair_agni[] = "}\n\n"; static constexpr int MAXLINE = 10240; -#define MAXWORD 40 +static constexpr int MAXWORD = 40; /* ---------------------------------------------------------------------- */ diff --git a/src/MOLECULE/pair_hbond_dreiding_lj.cpp b/src/MOLECULE/pair_hbond_dreiding_lj.cpp index 28985c3a88..dbd7db7780 100644 --- a/src/MOLECULE/pair_hbond_dreiding_lj.cpp +++ b/src/MOLECULE/pair_hbond_dreiding_lj.cpp @@ -38,7 +38,7 @@ using namespace MathConst; using namespace MathSpecial; static constexpr double SMALL = 0.001; -#define CHUNK 8 +static constexpr int CHUNK = 8; /* ---------------------------------------------------------------------- */ diff --git a/src/MOLECULE/pair_hbond_dreiding_morse.cpp b/src/MOLECULE/pair_hbond_dreiding_morse.cpp index b3e3584ccc..5cc45ea234 100644 --- a/src/MOLECULE/pair_hbond_dreiding_morse.cpp +++ b/src/MOLECULE/pair_hbond_dreiding_morse.cpp @@ -38,7 +38,7 @@ using namespace MathConst; using namespace MathSpecial; static constexpr double SMALL = 0.001; -#define CHUNK 8 +static constexpr int CHUNK = 8; /* ---------------------------------------------------------------------- */ diff --git a/src/OPENMP/msm_cg_omp.cpp b/src/OPENMP/msm_cg_omp.cpp index 551ab285a2..00230c9ece 100644 --- a/src/OPENMP/msm_cg_omp.cpp +++ b/src/OPENMP/msm_cg_omp.cpp @@ -38,7 +38,7 @@ using namespace LAMMPS_NS; -#define OFFSET 16384 +static constexpr int OFFSET = 16384; static constexpr double SMALLQ = 0.00001; enum{REVERSE_RHO,REVERSE_AD,REVERSE_AD_PERATOM}; diff --git a/src/OPENMP/pair_comb_omp.cpp b/src/OPENMP/pair_comb_omp.cpp index aceff6e111..87d467a846 100644 --- a/src/OPENMP/pair_comb_omp.cpp +++ b/src/OPENMP/pair_comb_omp.cpp @@ -32,7 +32,7 @@ using namespace LAMMPS_NS; using MathExtra::dot3; -#define MAXNEIGH 24 +static constexpr int MAXNEIGH = 24; /* ---------------------------------------------------------------------- */ diff --git a/src/OPENMP/pppm_cg_omp.cpp b/src/OPENMP/pppm_cg_omp.cpp index c003c3d857..0eff5c9363 100644 --- a/src/OPENMP/pppm_cg_omp.cpp +++ b/src/OPENMP/pppm_cg_omp.cpp @@ -41,7 +41,7 @@ using namespace MathSpecial; static constexpr FFT_SCALAR ZEROF = 0.0; static constexpr FFT_SCALAR ONEF = 1.0; -#define EPS_HOC 1.0e-7 +static constexpr double EPS_HOC = 1.0e-7; /* ---------------------------------------------------------------------- */ diff --git a/src/OPENMP/pppm_disp_omp.cpp b/src/OPENMP/pppm_disp_omp.cpp index 49893ab9c9..b610b1711e 100644 --- a/src/OPENMP/pppm_disp_omp.cpp +++ b/src/OPENMP/pppm_disp_omp.cpp @@ -40,7 +40,7 @@ using namespace MathConst; static constexpr FFT_SCALAR ZEROF = 0.0; static constexpr FFT_SCALAR ONEF = 1.0; -#define OFFSET 16384 +static constexpr int OFFSET = 16384; /* ---------------------------------------------------------------------- */ diff --git a/src/OPENMP/pppm_disp_tip4p_omp.cpp b/src/OPENMP/pppm_disp_tip4p_omp.cpp index bf37d307fc..bcc083e809 100644 --- a/src/OPENMP/pppm_disp_tip4p_omp.cpp +++ b/src/OPENMP/pppm_disp_tip4p_omp.cpp @@ -38,7 +38,7 @@ using namespace LAMMPS_NS; using namespace MathConst; static constexpr FFT_SCALAR ZEROF = 0.0; -#define OFFSET 16384 +static constexpr int OFFSET = 16384; /* ---------------------------------------------------------------------- */ diff --git a/src/OPENMP/pppm_omp.cpp b/src/OPENMP/pppm_omp.cpp index 0a21f4c647..a178483b8a 100644 --- a/src/OPENMP/pppm_omp.cpp +++ b/src/OPENMP/pppm_omp.cpp @@ -39,7 +39,7 @@ using namespace MathConst; using namespace MathSpecial; static constexpr FFT_SCALAR ZEROF = 0.0; -#define EPS_HOC 1.0e-7 +static constexpr double EPS_HOC = 1.0e-7; /* ---------------------------------------------------------------------- */ diff --git a/src/OPENMP/pppm_tip4p_omp.cpp b/src/OPENMP/pppm_tip4p_omp.cpp index 3ee85dc08e..420a116816 100644 --- a/src/OPENMP/pppm_tip4p_omp.cpp +++ b/src/OPENMP/pppm_tip4p_omp.cpp @@ -41,8 +41,8 @@ using namespace MathSpecial; static constexpr FFT_SCALAR ZEROF = 0.0; -#define EPS_HOC 1.0e-7 -#define OFFSET 16384 +static constexpr double EPS_HOC = 1.0e-7; +static constexpr int OFFSET = 16384; /* ---------------------------------------------------------------------- */ diff --git a/src/QEQ/fix_qeq_fire.cpp b/src/QEQ/fix_qeq_fire.cpp index 34ef51d947..50eff4f66d 100644 --- a/src/QEQ/fix_qeq_fire.cpp +++ b/src/QEQ/fix_qeq_fire.cpp @@ -34,7 +34,7 @@ using namespace LAMMPS_NS; using namespace FixConst; -#define DELAYSTEP 0 +static constexpr int DELAYSTEP = 0; #define DT_GROW 1.1 #define DT_SHRINK 0.5 #define ALPHA0 0.8 diff --git a/src/REPLICA/fix_neb.cpp b/src/REPLICA/fix_neb.cpp index d9ff870e12..9c920f26dc 100644 --- a/src/REPLICA/fix_neb.cpp +++ b/src/REPLICA/fix_neb.cpp @@ -40,7 +40,7 @@ using namespace MathConst; enum { SINGLE_PROC_DIRECT, SINGLE_PROC_MAP, MULTI_PROC }; enum { NEIGHBOR, IDEAL, EQUAL }; -#define BUFSIZE 8 +static constexpr int BUFSIZE = 8; /* ---------------------------------------------------------------------- */ diff --git a/src/SMTBQ/pair_smtbq.cpp b/src/SMTBQ/pair_smtbq.cpp index 134419a4dc..891cc3c7a6 100644 --- a/src/SMTBQ/pair_smtbq.cpp +++ b/src/SMTBQ/pair_smtbq.cpp @@ -74,7 +74,7 @@ static constexpr int MAXLINE = 2048; #define MAXTOKENS 2048 static constexpr int DELTA = 4; static constexpr int PGDELTA = 1; -#define MAXNEIGH 24 +static constexpr int MAXNEIGH = 24; static constexpr char SMTBQ_SEPARATORS[] = "' \t\n\r"; diff --git a/src/SPIN/fix_neb_spin.cpp b/src/SPIN/fix_neb_spin.cpp index ea8ce9c1fc..0d7703d06f 100644 --- a/src/SPIN/fix_neb_spin.cpp +++ b/src/SPIN/fix_neb_spin.cpp @@ -42,7 +42,7 @@ using namespace FixConst; enum{SINGLE_PROC_DIRECT,SINGLE_PROC_MAP,MULTI_PROC}; -#define BUFSIZE 8 +static constexpr int BUFSIZE = 8; /* ---------------------------------------------------------------------- */ diff --git a/src/SPIN/min_spin.cpp b/src/SPIN/min_spin.cpp index a2202cba32..99b3bd7145 100644 --- a/src/SPIN/min_spin.cpp +++ b/src/SPIN/min_spin.cpp @@ -38,7 +38,7 @@ using namespace MathConst; #define EPS_ENERGY 1.0e-8 -#define DELAYSTEP 5 +static constexpr int DELAYSTEP = 5; /* ---------------------------------------------------------------------- */ diff --git a/src/SPIN/min_spin_cg.cpp b/src/SPIN/min_spin_cg.cpp index ee72609ed9..25ea83d6de 100644 --- a/src/SPIN/min_spin_cg.cpp +++ b/src/SPIN/min_spin_cg.cpp @@ -56,7 +56,7 @@ static const char cite_minstyle_spin_cg[] = #define EPS_ENERGY 1.0e-8 -#define DELAYSTEP 5 +static constexpr int DELAYSTEP = 5; /* ---------------------------------------------------------------------- */ diff --git a/src/SPIN/min_spin_lbfgs.cpp b/src/SPIN/min_spin_lbfgs.cpp index ae9d33a705..357d8364e1 100644 --- a/src/SPIN/min_spin_lbfgs.cpp +++ b/src/SPIN/min_spin_lbfgs.cpp @@ -56,7 +56,7 @@ static const char cite_minstyle_spin_lbfgs[] = #define EPS_ENERGY 1.0e-8 -#define DELAYSTEP 5 +static constexpr int DELAYSTEP = 5; /* ---------------------------------------------------------------------- */ diff --git a/src/angle_hybrid.cpp b/src/angle_hybrid.cpp index 7419139942..e79776b0d2 100644 --- a/src/angle_hybrid.cpp +++ b/src/angle_hybrid.cpp @@ -24,7 +24,7 @@ using namespace LAMMPS_NS; -#define EXTRA 1000 +static constexpr int EXTRA = 1000; /* ---------------------------------------------------------------------- */ diff --git a/src/atom_map.cpp b/src/atom_map.cpp index c28b886335..37b46182c1 100644 --- a/src/atom_map.cpp +++ b/src/atom_map.cpp @@ -22,7 +22,7 @@ using namespace LAMMPS_NS; -#define EXTRA 1000 +static constexpr int EXTRA = 1000; /* ---------------------------------------------------------------------- allocate and initialize array or hash table for global -> local map diff --git a/src/bond_hybrid.cpp b/src/bond_hybrid.cpp index 4e477ab3a6..401358dda0 100644 --- a/src/bond_hybrid.cpp +++ b/src/bond_hybrid.cpp @@ -24,7 +24,7 @@ using namespace LAMMPS_NS; -#define EXTRA 1000 +static constexpr int EXTRA = 1000; /* ---------------------------------------------------------------------- */ diff --git a/src/dihedral_hybrid.cpp b/src/dihedral_hybrid.cpp index d38ccf5d52..9da4df1f68 100644 --- a/src/dihedral_hybrid.cpp +++ b/src/dihedral_hybrid.cpp @@ -24,7 +24,7 @@ using namespace LAMMPS_NS; -#define EXTRA 1000 +static constexpr int EXTRA = 1000; /* ---------------------------------------------------------------------- */ diff --git a/src/improper_hybrid.cpp b/src/improper_hybrid.cpp index 9aa20d236e..505488cce6 100644 --- a/src/improper_hybrid.cpp +++ b/src/improper_hybrid.cpp @@ -24,7 +24,7 @@ using namespace LAMMPS_NS; -#define EXTRA 1000 +static constexpr int EXTRA = 1000; /* ---------------------------------------------------------------------- */ diff --git a/src/min_quickmin.cpp b/src/min_quickmin.cpp index 99d95be57d..c3730f2cd7 100644 --- a/src/min_quickmin.cpp +++ b/src/min_quickmin.cpp @@ -30,7 +30,7 @@ using namespace LAMMPS_NS; #define EPS_ENERGY 1.0e-8 -#define DELAYSTEP 5 +static constexpr int DELAYSTEP = 5; /* ---------------------------------------------------------------------- */ diff --git a/src/read_dump.cpp b/src/read_dump.cpp index 7f8d4d6559..5972b369c8 100644 --- a/src/read_dump.cpp +++ b/src/read_dump.cpp @@ -33,7 +33,7 @@ using namespace LAMMPS_NS; -#define CHUNK 16384 +static constexpr int CHUNK = 16384; enum { NOADD, YESADD, KEEPADD }; diff --git a/src/variable.cpp b/src/variable.cpp index f4ab1c1dae..9284f7cb64 100644 --- a/src/variable.cpp +++ b/src/variable.cpp @@ -51,7 +51,7 @@ using namespace MathConst; #define VARDELTA 4 #define MAXLEVEL 4 static constexpr int MAXLINE = 256; -#define CHUNK 1024 +static constexpr int CHUNK = 1024; #define MAXFUNCARG 6 #define MYROUND(a) (( (a)-floor(a) ) >= .5) ? ceil(a) : floor(a)