use constexpr instead of define for better typechecking

This commit is contained in:
Axel Kohlmeyer
2020-12-22 10:40:28 -05:00
parent ce24d70ccc
commit 7a934eac37
2 changed files with 7 additions and 5 deletions

View File

@ -29,9 +29,6 @@
using namespace LAMMPS_NS;
using namespace MathConst;
#define DELTA 16384
#define DELTA_BONUS 8192
/* ---------------------------------------------------------------------- */
AtomVec::AtomVec(LAMMPS *lmp) : Pointers(lmp)
@ -188,6 +185,8 @@ void AtomVec::init()
error->all(FLERR,"KOKKOS package requires a kokkos enabled atom_style");
}
static constexpr bigint DELTA=16384;
/* ----------------------------------------------------------------------
roundup N so it is a multiple of DELTA
error if N exceeds 32-bit int, since will be used as arg to grow()
@ -211,6 +210,8 @@ void AtomVec::grow_nmax()
nmax += DELTA;
}
static constexpr bigint DELTA_BONUS=8192;
/* ----------------------------------------------------------------------
grow nmax_bonus so it is a multiple of DELTA_BONUS
------------------------------------------------------------------------- */