Unverified Commit 0d8110bc authored by Steve Plimpton's avatar Steve Plimpton Committed by GitHub
Browse files

Merge pull request #903 from akohlmey/move-enums-to-headers

Move enums that have to be consistent across files into a class
parents 44c5e88e 6226ec88
Loading
Loading
Loading
Loading
+1 −5
Original line number Diff line number Diff line
@@ -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");
    }
+2 −7
Original line number Diff line number Diff line
@@ -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");
    }
+2 −3
Original line number Diff line number Diff line
@@ -39,7 +39,6 @@ using namespace MathConst;

enum{ATOM,MOLECULE};
enum{ONE,RANGE,POLY};
enum{LAYOUT_UNIFORM,LAYOUT_NONUNIFORM,LAYOUT_TILED};    // several files

#define EPSILON 0.001
#define SMALL 1.0e-10
@@ -609,7 +608,7 @@ void FixPour::pre_exchange()
          newcoord[1] >= sublo[1] && newcoord[1] < subhi[1] &&
          newcoord[2] >= sublo[2] && newcoord[2] < subhi[2]) flag = 1;
      else if (dimension == 3 && newcoord[2] >= domain->boxhi[2]) {
        if (comm->layout != LAYOUT_TILED) {
        if (comm->layout != Comm::LAYOUT_TILED) {
          if (comm->myloc[2] == comm->procgrid[2]-1 &&
              newcoord[0] >= sublo[0] && newcoord[0] < subhi[0] &&
              newcoord[1] >= sublo[1] && newcoord[1] < subhi[1]) flag = 1;
@@ -619,7 +618,7 @@ void FixPour::pre_exchange()
              newcoord[1] >= sublo[1] && newcoord[1] < subhi[1]) flag = 1;
        }
      } else if (dimension == 2 && newcoord[1] >= domain->boxhi[1]) {
        if (comm->layout != LAYOUT_TILED) {
        if (comm->layout != Comm::LAYOUT_TILED) {
          if (comm->myloc[1] == comm->procgrid[1]-1 &&
              newcoord[0] >= sublo[0] && newcoord[0] < subhi[0]) flag = 1;
        } else {
+5 −7
Original line number Diff line number Diff line
@@ -36,8 +36,6 @@ using namespace LAMMPS_NS;
#define BUFMIN 10000
#define BUFEXTRA 1000

enum{SINGLE,MULTI};

/* ----------------------------------------------------------------------
   setup MPI and allocate buffer space
------------------------------------------------------------------------- */
@@ -709,7 +707,7 @@ void CommKokkos::borders()
  if (!exchange_comm_classic) {
    static int print = 1;

    if (style != SINGLE || bordergroup || ghost_velocity) {
    if (style != Comm::SINGLE || bordergroup || ghost_velocity) {
      if (print && comm->me==0) {
        error->warning(FLERR,"Required border comm not yet implemented in Kokkos communication, "
                      "switching to classic communication");
@@ -817,7 +815,7 @@ void CommKokkos::borders_device() {
      // store sent atom indices in list for use in future timesteps

      x = atom->x;
      if (style == SINGLE) {
      if (style == Comm::SINGLE) {
        lo = slablo[iswap];
        hi = slabhi[iswap];
      } else {
@@ -846,7 +844,7 @@ void CommKokkos::borders_device() {

      if (sendflag) {
        if (!bordergroup || ineed >= 2) {
          if (style == SINGLE) {
          if (style == Comm::SINGLE) {
            k_total_send.h_view() = 0;
            k_total_send.template modify<LMPHostType>();
            k_total_send.template sync<LMPDeviceType>();
@@ -894,7 +892,7 @@ void CommKokkos::borders_device() {
        } else {
          error->all(FLERR,"Required border comm not yet "
                     "implemented with Kokkos");
          if (style == SINGLE) {
          if (style == Comm::SINGLE) {
            ngroup = atom->nfirst;
            for (i = 0; i < ngroup; i++)
              if (x[i][dim] >= lo && x[i][dim] <= hi) {
@@ -1099,7 +1097,7 @@ void CommKokkos::grow_swap(int n)
{
  free_swap();
  allocate_swap(n);
  if (style == MULTI) {
  if (style == Comm::MULTI) {
    free_multi();
    allocate_multi(n);
  }
+0 −3
Original line number Diff line number Diff line
@@ -39,9 +39,6 @@ using namespace LAMMPS_NS;

#define DELTA_PROCS 16

enum{SINGLE,MULTI};               // same as in Comm
enum{LAYOUT_UNIFORM,LAYOUT_NONUNIFORM,LAYOUT_TILED};    // several files

/* ---------------------------------------------------------------------- */

CommTiledKokkos::CommTiledKokkos(LAMMPS *lmp) : CommTiled(lmp)
Loading