more use of constexpr
This commit is contained in:
@ -38,7 +38,7 @@ class PairComb : public Pair {
|
||||
virtual double yasu_char(double *, int &);
|
||||
double enegtot;
|
||||
|
||||
static const int NPARAMS_PER_LINE = 49;
|
||||
static constexpr int NPARAMS_PER_LINE = 49;
|
||||
|
||||
protected:
|
||||
struct Param {
|
||||
|
||||
@ -37,7 +37,7 @@ class PairComb3 : public Pair {
|
||||
virtual double combqeq(double *, int &);
|
||||
double enegtot;
|
||||
|
||||
static const int NPARAMS_PER_LINE = 74;
|
||||
static constexpr int NPARAMS_PER_LINE = 74;
|
||||
|
||||
protected:
|
||||
// general potential parameters
|
||||
|
||||
@ -34,7 +34,7 @@ class PairGW : public Pair {
|
||||
void init_style();
|
||||
double init_one(int, int);
|
||||
|
||||
static const int NPARAMS_PER_LINE = 17;
|
||||
static constexpr int NPARAMS_PER_LINE = 17;
|
||||
|
||||
protected:
|
||||
struct Param {
|
||||
|
||||
@ -29,7 +29,7 @@ class PairGWZBL : public PairGW {
|
||||
PairGWZBL(class LAMMPS *);
|
||||
~PairGWZBL() {}
|
||||
|
||||
static const int NPARAMS_PER_LINE = 21;
|
||||
static constexpr int NPARAMS_PER_LINE = 21;
|
||||
|
||||
private:
|
||||
double global_a_0; // Bohr radius for Coulomb repulsion
|
||||
|
||||
@ -34,7 +34,7 @@ class PairNb3bHarmonic : public Pair {
|
||||
double init_one(int, int);
|
||||
void init_style();
|
||||
|
||||
static const int NPARAMS_PER_LINE = 6;
|
||||
static constexpr int NPARAMS_PER_LINE = 6;
|
||||
|
||||
protected:
|
||||
struct Param {
|
||||
|
||||
@ -34,7 +34,7 @@ class PairSW : public Pair {
|
||||
virtual double init_one(int, int);
|
||||
virtual void init_style();
|
||||
|
||||
static const int NPARAMS_PER_LINE = 14;
|
||||
static constexpr int NPARAMS_PER_LINE = 14;
|
||||
|
||||
struct Param {
|
||||
double epsilon,sigma;
|
||||
|
||||
@ -34,7 +34,7 @@ class PairTersoff : public Pair {
|
||||
virtual void init_style();
|
||||
double init_one(int, int);
|
||||
|
||||
static const int NPARAMS_PER_LINE = 17;
|
||||
static constexpr int NPARAMS_PER_LINE = 17;
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
@ -30,7 +30,7 @@ class PairTersoffMOD : public PairTersoff {
|
||||
PairTersoffMOD(class LAMMPS *);
|
||||
~PairTersoffMOD() {}
|
||||
|
||||
static const int NPARAMS_PER_LINE = 20;
|
||||
static constexpr int NPARAMS_PER_LINE = 20;
|
||||
|
||||
protected:
|
||||
virtual void read_file(char *);
|
||||
|
||||
@ -29,7 +29,7 @@ class PairTersoffMODC : public PairTersoffMOD {
|
||||
PairTersoffMODC(class LAMMPS *lmp) : PairTersoffMOD(lmp) {};
|
||||
~PairTersoffMODC() {}
|
||||
|
||||
static const int NPARAMS_PER_LINE = 21;
|
||||
static constexpr int NPARAMS_PER_LINE = 21;
|
||||
|
||||
protected:
|
||||
void read_file(char *);
|
||||
|
||||
@ -29,7 +29,7 @@ class PairTersoffZBL : public PairTersoff {
|
||||
PairTersoffZBL(class LAMMPS *);
|
||||
~PairTersoffZBL() {}
|
||||
|
||||
static const int NPARAMS_PER_LINE = 21;
|
||||
static constexpr int NPARAMS_PER_LINE = 21;
|
||||
|
||||
protected:
|
||||
double global_a_0; // Bohr radius for Coulomb repulsion
|
||||
|
||||
@ -34,7 +34,7 @@ class PairVashishta : public Pair {
|
||||
double init_one(int, int);
|
||||
void init_style();
|
||||
|
||||
static const int NPARAMS_PER_LINE = 17;
|
||||
static constexpr int NPARAMS_PER_LINE = 17;
|
||||
|
||||
struct Param {
|
||||
double bigb,gamma,r0,bigc,costheta;
|
||||
|
||||
@ -33,21 +33,21 @@ namespace LAMMPS_NS {
|
||||
TORQUE = 1<<8
|
||||
};
|
||||
|
||||
static const double TOLERANCE = 1.0e-6;
|
||||
static const double EPSILON = 1.0e-7;
|
||||
static const double BIG = 1.0e20;
|
||||
static constexpr double TOLERANCE = 1.0e-6;
|
||||
static constexpr double EPSILON = 1.0e-7;
|
||||
static constexpr double BIG = 1.0e20;
|
||||
|
||||
// moment of inertia prefactor for sphere
|
||||
static const double SINERTIA = 0.4;
|
||||
static constexpr double SINERTIA = 0.4;
|
||||
// moment of inertia prefactor for ellipsoid
|
||||
static const double EINERTIA = 0.2;
|
||||
static constexpr double EINERTIA = 0.2;
|
||||
// moment of inertia prefactor for line segment
|
||||
static const double LINERTIA = 1.0/12.0;
|
||||
static constexpr double LINERTIA = 1.0/12.0;
|
||||
|
||||
static const int MAXLINE = 1024;
|
||||
static const int CHUNK = 1024;
|
||||
static const int DELTA_BODY = 10000;
|
||||
static const int ATTRIBUTE_PERBODY = 20;
|
||||
static constexpr int MAXLINE = 1024;
|
||||
static constexpr int CHUNK = 1024;
|
||||
static constexpr int DELTA_BODY = 10000;
|
||||
static constexpr int ATTRIBUTE_PERBODY = 20;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -43,7 +43,7 @@ class PairTersoffTable : public Pair {
|
||||
void init_style();
|
||||
double init_one(int, int);
|
||||
|
||||
static const int NPARAMS_PER_LINE = 17;
|
||||
static constexpr int NPARAMS_PER_LINE = 17;
|
||||
|
||||
protected:
|
||||
struct Param {
|
||||
|
||||
@ -36,7 +36,7 @@ class PairCoulStreitz : public Pair {
|
||||
double memory_usage();
|
||||
virtual void *extract(const char *, int &);
|
||||
|
||||
static const int NPARAMS_PER_LINE = 6;
|
||||
static constexpr int NPARAMS_PER_LINE = 6;
|
||||
|
||||
protected:
|
||||
struct Param {
|
||||
|
||||
@ -27,7 +27,7 @@ namespace LAMMPS_NS
|
||||
class TextFileReader {
|
||||
std::string filename;
|
||||
std::string filetype;
|
||||
static const int MAXLINE = 1024;
|
||||
static constexpr int MAXLINE = 1024;
|
||||
char line[MAXLINE];
|
||||
FILE *fp;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user