USER-DPD: move nstencil_ssa out of core LAMMPS into USER-DPD
This commit is contained in:
@ -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]) {
|
||||
|
||||
|
||||
@ -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
|
||||
}
|
||||
|
||||
@ -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() {}
|
||||
|
||||
@ -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
|
||||
}
|
||||
|
||||
@ -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() {}
|
||||
|
||||
36
src/USER-DPD/nstencil_ssa.h
Normal file
36
src/USER-DPD/nstencil_ssa.h
Normal file
@ -0,0 +1,36 @@
|
||||
/* -*- c++ -*- ----------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
http://lammps.sandia.gov, Sandia National Laboratories
|
||||
Steve Plimpton, sjplimp@sandia.gov
|
||||
|
||||
Copyright (2003) Sandia Corporation. Under the terms of Contract
|
||||
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
|
||||
certain rights in this software. This software is distributed under
|
||||
the GNU General Public License.
|
||||
|
||||
See the README file in the top-level LAMMPS directory.
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
#ifndef LMP_NSTENCIL_SSA_H
|
||||
#define LMP_NSTENCIL_SSA_H
|
||||
|
||||
#include "nstencil.h"
|
||||
|
||||
namespace LAMMPS_NS {
|
||||
|
||||
class NStencilSSA : public NStencil {
|
||||
public:
|
||||
NStencilSSA(class LAMMPS *lmp) : NStencil(lmp) { }
|
||||
~NStencilSSA() {}
|
||||
virtual void create() = 0;
|
||||
|
||||
int nstencil_half; // where the half stencil ends
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/* ERROR/WARNING messages:
|
||||
|
||||
*/
|
||||
@ -113,7 +113,6 @@ void NPair::copy_bin_info()
|
||||
void NPair::copy_stencil_info()
|
||||
{
|
||||
nstencil = ns->nstencil;
|
||||
nstencil_ssa = ns->nstencil_ssa;
|
||||
stencil = ns->stencil;
|
||||
stencilxyz = ns->stencilxyz;
|
||||
nstencil_multi = ns->nstencil_multi;
|
||||
|
||||
@ -81,7 +81,6 @@ class NPair : protected Pointers {
|
||||
// data from NStencil class
|
||||
|
||||
int nstencil;
|
||||
int nstencil_ssa;
|
||||
int *stencil;
|
||||
int **stencilxyz;
|
||||
int *nstencil_multi;
|
||||
|
||||
@ -28,7 +28,6 @@ class NStencil : protected Pointers {
|
||||
bigint last_copy_bin;
|
||||
|
||||
int nstencil; // # of bins in stencil
|
||||
int nstencil_ssa; // # of total bins in SSA stencil
|
||||
int *stencil; // list of bin offsets
|
||||
int **stencilxyz; // bin offsets in xyz dims
|
||||
int *nstencil_multi; // # bins in each type-based multi stencil
|
||||
|
||||
Reference in New Issue
Block a user