Commit 81fcbcd9 authored by Tim Mattox's avatar Tim Mattox
Browse files

USER-DPD: move nstencil_ssa out of core LAMMPS into USER-DPD

parent 82c6eb46
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@

#include "npair_half_bin_newton_ssa.h"
#include "neighbor.h"
#include "nstencil_ssa.h"
#include "nbin_ssa.h"
#include "neigh_list.h"
#include "atom.h"
@@ -79,6 +80,11 @@ void NPairHalfBinNewtonSSA::build(NeighList *list)
  int **firstneigh = list->firstneigh;
  MyPage<int> *ipage = list->ipage;

  NStencilSSA *ns_ssa = dynamic_cast<NStencilSSA*>(ns);
  if (!ns_ssa) error->one(FLERR, "NStencil wasn't a NStencilSSA object");
  int nstencil_half = ns_ssa->nstencil_half;
  int nstencil_full = ns_ssa->nstencil;

  NBinSSA *nb_ssa = dynamic_cast<NBinSSA*>(nb);
  if (!nb_ssa) error->one(FLERR, "NBin wasn't a NBinSSA object");
  int *bins_ssa = nb_ssa->bins_ssa;
@@ -140,7 +146,7 @@ void NPairHalfBinNewtonSSA::build(NeighList *list)

    // loop over all local atoms in other bins in "half" stencil

    for (k = 0; k < nstencil; k++) {
    for (k = 0; k < nstencil_half; k++) {
      for (j = binhead_ssa[ibin+stencil[k]]; j >= 0; 
           j = bins_ssa[j]) {

@@ -176,7 +182,7 @@ void NPairHalfBinNewtonSSA::build(NeighList *list)
    // That is a significant time savings because of the "full" stencil
    // Note2: only non-pure locals can have ghosts as neighbors

    if (ssaAIR[i] == 1) for (k = 0; k < nstencil_ssa; k++) {
    if (ssaAIR[i] == 1) for (k = 0; k < nstencil_full; k++) {
      for (j = gbinhead_ssa[ibin+stencil[k]]; j >= 0; 
           j = bins_ssa[j]) {

+3 −3
Original line number Diff line number Diff line
@@ -25,7 +25,7 @@ using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */

NStencilHalfBin2dNewtonSSA::NStencilHalfBin2dNewtonSSA(LAMMPS *lmp) : 
  NStencil(lmp) {}
  NStencilSSA(lmp) {}

/* ----------------------------------------------------------------------
   create stencil based on bin geometry and cutoff
@@ -49,7 +49,7 @@ void NStencilHalfBin2dNewtonSSA::create()
        if (bin_distance(i,j,0) < cutneighmaxsq)
          stencil[pos++] = j*mbinx + i;

  nstencil = pos; // record where normal half stencil ends
  nstencil_half = pos; // record where normal half stencil ends

  // include additional bins for AIR ghosts only

@@ -60,5 +60,5 @@ void NStencilHalfBin2dNewtonSSA::create()
        stencil[pos++] = j*mbinx + i;
    }

  nstencil_ssa = pos; // record where full stencil ends
  nstencil = pos; // record where full stencil ends
}
+2 −2
Original line number Diff line number Diff line
@@ -22,11 +22,11 @@ NStencilStyle(half/bin/2d/newton/ssa,
#ifndef LMP_NSTENCIL_HALF_BIN_2D_NEWTON_SSA_H
#define LMP_NSTENCIL_HALF_BIN_2D_NEWTON_SSA_H

#include "nstencil.h"
#include "nstencil_ssa.h"

namespace LAMMPS_NS {

class NStencilHalfBin2dNewtonSSA : public NStencil {
class NStencilHalfBin2dNewtonSSA : public NStencilSSA {
 public:
  NStencilHalfBin2dNewtonSSA(class LAMMPS *);
  ~NStencilHalfBin2dNewtonSSA() {}
+3 −3
Original line number Diff line number Diff line
@@ -25,7 +25,7 @@ using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */

NStencilHalfBin3dNewtonSSA::NStencilHalfBin3dNewtonSSA(LAMMPS *lmp) : 
  NStencil(lmp) {}
  NStencilSSA(lmp) {}

/* ----------------------------------------------------------------------
   create stencil based on bin geometry and cutoff
@@ -50,7 +50,7 @@ void NStencilHalfBin3dNewtonSSA::create()
          if (bin_distance(i,j,k) < cutneighmaxsq)
            stencil[pos++] = k*mbiny*mbinx + j*mbinx + i;

  nstencil = pos; // record where normal half stencil ends
  nstencil_half = pos; // record where normal half stencil ends

  // include additional bins for AIR ghosts only

@@ -70,5 +70,5 @@ void NStencilHalfBin3dNewtonSSA::create()
        stencil[pos++] = k*mbiny*mbinx + j*mbinx + i;
    }

  nstencil_ssa = pos; // record where full stencil ends
  nstencil = pos; // record where full stencil ends
}
+2 −2
Original line number Diff line number Diff line
@@ -22,11 +22,11 @@ NStencilStyle(half/bin/3d/newton/ssa,
#ifndef LMP_NSTENCIL_HALF_BIN_3D_NEWTON_SSA_H
#define LMP_NSTENCIL_HALF_BIN_3D_NEWTON_SSA_H

#include "nstencil.h"
#include "nstencil_ssa.h"

namespace LAMMPS_NS {

class NStencilHalfBin3dNewtonSSA : public NStencil {
class NStencilHalfBin3dNewtonSSA : public NStencilSSA {
 public:
  NStencilHalfBin3dNewtonSSA(class LAMMPS *);
  ~NStencilHalfBin3dNewtonSSA() {}
Loading