enumerators must be defined within the scope of the class, not globally

This commit is contained in:
Axel Kohlmeyer
2025-02-23 12:17:48 -05:00
parent f29a433fa9
commit 35fca290fc
4 changed files with 19 additions and 16 deletions

View File

@ -35,7 +35,7 @@ using namespace LAMMPS_NS;
BosonicExchange::BosonicExchange(LAMMPS *lmp, int nbosons, int np, int bead_num, bool mic,
bool beta_convention) :
Pointers(lmp), nbosons(nbosons), np(np), bead_num(bead_num), apply_minimum_image(mic),
physical_beta_convention(beta_convention), x(nullptr), x_pref(nullptr), x_next(nullptr),
physical_beta_convention(beta_convention), x(nullptr), x_prev(nullptr), x_next(nullptr),
E_kn(nullptr), V(nullptr), V_backwards(nullptr), connection_probabilities(nullptr),
temp_nbosons_array(nullptr)
{

View File

@ -53,8 +53,12 @@ using MathConst::MY_SQRT2;
using MathConst::THIRD;
using MathSpecial::powint;
static std::map<int, std::string> Barostats{{MTTK, "MTTK"}, {BZP, "BZP"}};
static std::map<int, std::string> Ensembles{{NVE, "NVE"}, {NVT, "NVT"}, {NPH, "NPH"}, {NPT, "NPT"}};
static std::map<int, std::string> Barostats{{FixPIMDLangevin::MTTK, "MTTK"},
{FixPIMDLangevin::BZP, "BZP"}};
static std::map<int, std::string> Ensembles{{FixPIMDLangevin::NVE, "NVE"},
{FixPIMDLangevin::NVT, "NVT"},
{FixPIMDLangevin::NPH, "NPH"},
{FixPIMDLangevin::NPT, "NPT"}};
/* ---------------------------------------------------------------------- */
@ -240,7 +244,7 @@ FixPIMDLangevin::FixPIMDLangevin(LAMMPS *lmp, int narg, char **arg) :
else if (strcmp(arg[i + 1], "no") == 0)
removecomflag = 0;
} else if (strcmp(arg[i], "") != 0) {
error->universe_all(FLERR, fmt::format("Unknown keyword {} for fix {}", arg[i], style));
error->universe_all(FLERR, fmt::format("Unknown keyword {} for fix {}", arg[i], style));
}
}

View File

@ -22,15 +22,6 @@ FixStyle(pimd/langevin,FixPIMDLangevin);
#include "fix.h"
enum { PIMD, NMPIMD };
enum { PHYSICAL, NORMAL };
enum { BAOAB, OBABO };
enum { ISO, ANISO, TRICLINIC };
enum { PILE_L };
enum { MTTK, BZP };
enum { NVE, NVT, NPH, NPT };
enum { SINGLE_PROC, MULTI_PROC };
namespace LAMMPS_NS {
class FixPIMDLangevin : public Fix {
@ -38,6 +29,15 @@ class FixPIMDLangevin : public Fix {
FixPIMDLangevin(class LAMMPS *, int, char **);
~FixPIMDLangevin() override;
enum { PIMD, NMPIMD };
enum { PHYSICAL, NORMAL };
enum { BAOAB, OBABO };
enum { ISO, ANISO, TRICLINIC };
enum { PILE_L };
enum { MTTK, BZP };
enum { NVE, NVT, NPH, NPT };
enum { SINGLE_PROC, MULTI_PROC };
int setmask() override;
void init() override;

View File

@ -25,13 +25,13 @@ FixStyle(pimd/nvt,FixPIMDNVT);
namespace LAMMPS_NS {
enum { PIMD, NMPIMD, CMD };
class FixPIMDNVT : public Fix {
public:
FixPIMDNVT(class LAMMPS *, int, char **);
~FixPIMDNVT() override;
enum { PIMD, NMPIMD, CMD };
int setmask() override;
void init() override;
@ -55,7 +55,6 @@ class FixPIMDNVT : public Fix {
void unpack_forward_comm(int, int, double *) override;
protected:
int method;
int np;
double inverse_np;