move enum{NO_REMAP,X_REMAP,V_REMAP} to Domain class in domain.h

This commit is contained in:
Axel Kohlmeyer
2018-05-10 00:20:10 -04:00
parent b6a8168e3f
commit 3682bc47c2
15 changed files with 21 additions and 61 deletions

View File

@ -43,10 +43,6 @@
using namespace LAMMPS_NS;
using namespace MathConst;
// same as fix_deform.cpp
enum{NO_REMAP,X_REMAP,V_REMAP};
// same as fix_wall.cpp
enum{EDGE,CONSTANT,VARIABLE};
@ -570,7 +566,7 @@ void PairLubricate::init_style()
for (int i = 0; i < modify->nfix; i++){
if (strcmp(modify->fix[i]->style,"deform") == 0) {
shearing = flagdeform = 1;
if (((FixDeform *) modify->fix[i])->remapflag != V_REMAP)
if (((FixDeform *) modify->fix[i])->remapflag != Domain::V_REMAP)
error->all(FLERR,"Using pair lubricate with inconsistent "
"fix deform remap option");
}

View File

@ -44,11 +44,6 @@
using namespace LAMMPS_NS;
using namespace MathConst;
// same as fix_deform.cpp
enum{NO_REMAP,X_REMAP,V_REMAP};
// same as fix_wall.cpp
enum{EDGE,CONSTANT,VARIABLE};
@ -474,7 +469,7 @@ void PairLubricatePoly::init_style()
for (int i = 0; i < modify->nfix; i++){
if (strcmp(modify->fix[i]->style,"deform") == 0) {
shearing = flagdeform = 1;
if (((FixDeform *) modify->fix[i])->remapflag != V_REMAP)
if (((FixDeform *) modify->fix[i])->remapflag != Domain::V_REMAP)
error->all(FLERR,"Using pair lubricate with inconsistent "
"fix deform remap option");
}
@ -550,7 +545,7 @@ void PairLubricatePoly::init_style()
for (int i = 0; i < modify->nfix; i++)
if (strcmp(modify->fix[i]->style,"deform") == 0) {
shearing = 1;
if (((FixDeform *) modify->fix[i])->remapflag != V_REMAP)
if (((FixDeform *) modify->fix[i])->remapflag != Domain::V_REMAP)
error->all(FLERR,"Using pair lubricate/poly with inconsistent "
"fix deform remap option");
}

View File

@ -41,10 +41,6 @@ using namespace MathConst;
enum{NONE,FINAL,DELTA,SCALE,VEL,ERATE,TRATE,VOLUME,WIGGLE,VARIABLE};
enum{ONE_FROM_ONE,ONE_FROM_TWO,TWO_FROM_ONE};
// same as domain.cpp, fix_nvt_sllod.cpp, compute_temp_deform.cpp
enum{NO_REMAP,X_REMAP,V_REMAP};
/* ---------------------------------------------------------------------- */
FixDeformKokkos::FixDeformKokkos(LAMMPS *lmp, int narg, char **arg) : FixDeform(lmp, narg, arg)
@ -315,7 +311,7 @@ void FixDeformKokkos::end_of_step()
// convert atoms and rigid bodies to lamda coords
if (remapflag == X_REMAP) {
if (remapflag == Domain::X_REMAP) {
int nlocal = atom->nlocal;
domainKK->x2lamda(nlocal);
@ -355,7 +351,7 @@ void FixDeformKokkos::end_of_step()
// convert atoms and rigid bodies back to box coords
if (remapflag == X_REMAP) {
if (remapflag == Domain::X_REMAP) {
int nlocal = atom->nlocal;
domainKK->lamda2x(nlocal);

View File

@ -52,8 +52,6 @@ enum{BIG_MOVE,SRD_MOVE,SRD_ROTATE};
enum{CUBIC_ERROR,CUBIC_WARN};
enum{SHIFT_NO,SHIFT_YES,SHIFT_POSSIBLE};
enum{NO_REMAP,X_REMAP,V_REMAP}; // same as fix_deform.cpp
#define EINERTIA 0.2 // moment of inertia prefactor for ellipsoid
#define ATOMPERBIN 30
@ -384,7 +382,7 @@ void FixSRD::init()
if (strcmp(modify->fix[i]->style,"deform") == 0) {
deformflag = 1;
FixDeform *deform = (FixDeform *) modify->fix[i];
if (deform->box_change_shape && deform->remapflag != V_REMAP)
if (deform->box_change_shape && deform->remapflag != Domain::V_REMAP)
error->all(FLERR,"Using fix srd with inconsistent "
"fix deform remap option");
}

View File

@ -35,8 +35,6 @@
using namespace LAMMPS_NS;
enum{NO_REMAP,X_REMAP,V_REMAP}; // same as fix_deform.cpp
/* ---------------------------------------------------------------------- */
ComputeTempDeformEff::ComputeTempDeformEff(LAMMPS *lmp, int narg, char **arg) :
@ -76,7 +74,7 @@ void ComputeTempDeformEff::init()
int i;
for (i = 0; i < modify->nfix; i++)
if (strcmp(modify->fix[i]->style,"deform") == 0) {
if (((FixDeform *) modify->fix[i])->remapflag == X_REMAP &&
if (((FixDeform *) modify->fix[i])->remapflag == Domain::X_REMAP &&
comm->me == 0)
error->warning(FLERR,"Using compute temp/deform/eff with inconsistent "
"fix deform remap option");

View File

@ -27,8 +27,6 @@
using namespace LAMMPS_NS;
using namespace FixConst;
enum{NO_REMAP,X_REMAP,V_REMAP}; // same as fix_deform.cpp
/* ---------------------------------------------------------------------- */
FixNVTSllodEff::FixNVTSllodEff(LAMMPS *lmp, int narg, char **arg) :
@ -78,7 +76,7 @@ void FixNVTSllodEff::init()
int i;
for (i = 0; i < modify->nfix; i++)
if (strcmp(modify->fix[i]->style,"deform") == 0) {
if (((FixDeform *) modify->fix[i])->remapflag != V_REMAP)
if (((FixDeform *) modify->fix[i])->remapflag != Domain::V_REMAP)
error->all(FLERR,"Using fix nvt/sllod/eff with inconsistent fix deform "
"remap option");
break;

View File

@ -27,8 +27,6 @@
using namespace LAMMPS_NS;
using namespace FixConst;
enum{NO_REMAP,X_REMAP,V_REMAP}; // same as fix_deform.cpp
/* ---------------------------------------------------------------------- */
FixNVTSllodIntel::FixNVTSllodIntel(LAMMPS *lmp, int narg, char **arg) :
@ -79,7 +77,7 @@ void FixNVTSllodIntel::init()
int i;
for (i = 0; i < modify->nfix; i++)
if (strcmp(modify->fix[i]->style,"deform") == 0) {
if (((FixDeform *) modify->fix[i])->remapflag != V_REMAP)
if (((FixDeform *) modify->fix[i])->remapflag != Domain::V_REMAP)
error->all(FLERR,"Using fix nvt/sllod with inconsistent fix deform "
"remap option");
break;

View File

@ -31,8 +31,6 @@
using namespace LAMMPS_NS;
using namespace FixConst;
enum{NO_REMAP,X_REMAP,V_REMAP}; // same as fix_deform.cpp
typedef struct { double x,y,z; } dbl3_t;
/* ---------------------------------------------------------------------- */
@ -85,7 +83,7 @@ void FixNVTSllodOMP::init()
int i;
for (i = 0; i < modify->nfix; i++)
if (strcmp(modify->fix[i]->style,"deform") == 0) {
if (((FixDeform *) modify->fix[i])->remapflag != V_REMAP)
if (((FixDeform *) modify->fix[i])->remapflag != Domain::V_REMAP)
error->all(FLERR,"Using fix nvt/sllod/omp with inconsistent fix "
"deform remap option");
break;

View File

@ -32,10 +32,6 @@
using namespace LAMMPS_NS;
using namespace MathConst;
// same as fix_deform.cpp
enum{NO_REMAP,X_REMAP,V_REMAP};
// same as fix_wall.cpp
enum{EDGE,CONSTANT,VARIABLE};

View File

@ -32,11 +32,6 @@
using namespace LAMMPS_NS;
using namespace MathConst;
// same as fix_deform.cpp
enum{NO_REMAP,X_REMAP,V_REMAP};
// same as fix_wall.cpp
enum{EDGE,CONSTANT,VARIABLE};

View File

@ -32,8 +32,6 @@
using namespace LAMMPS_NS;
enum{NO_REMAP,X_REMAP,V_REMAP}; // same as fix_deform.cpp
/* ---------------------------------------------------------------------- */
ComputeTempDeform::ComputeTempDeform(LAMMPS *lmp, int narg, char **arg) :
@ -71,7 +69,7 @@ void ComputeTempDeform::init()
for (i = 0; i < modify->nfix; i++)
if (strcmp(modify->fix[i]->style,"deform") == 0) {
if (((FixDeform *) modify->fix[i])->remapflag == X_REMAP &&
if (((FixDeform *) modify->fix[i])->remapflag == Domain::X_REMAP &&
comm->me == 0)
error->warning(FLERR,"Using compute temp/deform with inconsistent "
"fix deform remap option");

View File

@ -44,7 +44,6 @@
using namespace LAMMPS_NS;
using namespace MathConst;
enum{NO_REMAP,X_REMAP,V_REMAP}; // same as fix_deform.cpp
enum{LAYOUT_UNIFORM,LAYOUT_NONUNIFORM,LAYOUT_TILED}; // several files
#define BIG 1.0e20
@ -154,7 +153,7 @@ void Domain::init()
for (int i = 0; i < modify->nfix; i++)
if (strcmp(modify->fix[i]->style,"deform") == 0) {
deform_flag = 1;
if (((FixDeform *) modify->fix[i])->remapflag == V_REMAP) {
if (((FixDeform *) modify->fix[i])->remapflag == Domain::V_REMAP) {
deform_vremap = 1;
deform_groupbit = modify->fix[i]->groupbit;
}

View File

@ -93,6 +93,7 @@ class Domain : protected Pointers {
class Region **regions; // list of defined Regions
int copymode;
enum{NO_REMAP,X_REMAP,V_REMAP};
typedef Region *(*RegionCreator)(LAMMPS *,int,char**);
typedef std::map<std::string,RegionCreator> RegionCreatorMap;

View File

@ -40,10 +40,6 @@ using namespace MathConst;
enum{NONE=0,FINAL,DELTA,SCALE,VEL,ERATE,TRATE,VOLUME,WIGGLE,VARIABLE};
enum{ONE_FROM_ONE,ONE_FROM_TWO,TWO_FROM_ONE};
// same as domain.cpp, fix_nvt_sllod.cpp, compute_temp_deform.cpp
enum{NO_REMAP,X_REMAP,V_REMAP};
/* ---------------------------------------------------------------------- */
FixDeform::FixDeform(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg),
@ -208,7 +204,7 @@ rfix(NULL), irregular(NULL), set(NULL)
// no x remap effectively moves atoms within box, so set restart_pbc
options(narg-iarg,&arg[iarg]);
if (remapflag != X_REMAP) restart_pbc = 1;
if (remapflag != Domain::X_REMAP) restart_pbc = 1;
// setup dimflags used by other classes to check for volume-change conflicts
@ -890,7 +886,7 @@ void FixDeform::end_of_step()
// convert atoms and rigid bodies to lamda coords
if (remapflag == X_REMAP) {
if (remapflag == Domain::X_REMAP) {
double **x = atom->x;
int *mask = atom->mask;
int nlocal = atom->nlocal;
@ -930,7 +926,7 @@ void FixDeform::end_of_step()
// convert atoms and rigid bodies back to box coords
if (remapflag == X_REMAP) {
if (remapflag == Domain::X_REMAP) {
double **x = atom->x;
int *mask = atom->mask;
int nlocal = atom->nlocal;
@ -992,7 +988,7 @@ void FixDeform::options(int narg, char **arg)
{
if (narg < 0) error->all(FLERR,"Illegal fix deform command");
remapflag = X_REMAP;
remapflag = Domain::X_REMAP;
scaleflag = 1;
flipflag = 1;
@ -1000,9 +996,9 @@ void FixDeform::options(int narg, char **arg)
while (iarg < narg) {
if (strcmp(arg[iarg],"remap") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal fix deform command");
if (strcmp(arg[iarg+1],"x") == 0) remapflag = X_REMAP;
else if (strcmp(arg[iarg+1],"v") == 0) remapflag = V_REMAP;
else if (strcmp(arg[iarg+1],"none") == 0) remapflag = NO_REMAP;
if (strcmp(arg[iarg+1],"x") == 0) remapflag = Domain::X_REMAP;
else if (strcmp(arg[iarg+1],"v") == 0) remapflag = Domain::V_REMAP;
else if (strcmp(arg[iarg+1],"none") == 0) remapflag = Domain::NO_REMAP;
else error->all(FLERR,"Illegal fix deform command");
iarg += 2;
} else if (strcmp(arg[iarg],"units") == 0) {

View File

@ -31,8 +31,6 @@
using namespace LAMMPS_NS;
using namespace FixConst;
enum{NO_REMAP,X_REMAP,V_REMAP}; // same as fix_deform.cpp
/* ---------------------------------------------------------------------- */
FixNVTSllod::FixNVTSllod(LAMMPS *lmp, int narg, char **arg) :
@ -83,7 +81,7 @@ void FixNVTSllod::init()
int i;
for (i = 0; i < modify->nfix; i++)
if (strcmp(modify->fix[i]->style,"deform") == 0) {
if (((FixDeform *) modify->fix[i])->remapflag != V_REMAP)
if (((FixDeform *) modify->fix[i])->remapflag != Domain::V_REMAP)
error->all(FLERR,"Using fix nvt/sllod with inconsistent fix deform "
"remap option");
break;