#include "nstencil_half_bin_2d_newton_ssa.h"
using namespace LAMMPS_NS;
NStencilHalfBin2dNewtonSSA::NStencilHalfBin2dNewtonSSA(LAMMPS *lmp) :
NStencilSSA(lmp) {}
void NStencilHalfBin2dNewtonSSA::create()
{
int i,j,pos = 0;
nstencil_ssa[0] = 0;
stencilxyz[pos][0] = 0;
stencilxyz[pos][1] = 0;
stencilxyz[pos][2] = 0;
stencil[pos++] = 0;
for (j = 0; j <= sy; j++)
for (i = 0; i <= sx; i++)
if (j > 0 || i > 0) if (bin_distance(i,j,0) < cutneighmaxsq) {
stencilxyz[pos][0] = i;
stencilxyz[pos][1] = j;
stencilxyz[pos][2] = 0;
stencil[pos++] = j*mbinx + i;
}
nstencil_ssa[1] = pos;
for (j = 1; j <= sy; j++)
for (i = -sx; i < 0; i++)
if (bin_distance(i,j,0) < cutneighmaxsq) {
stencilxyz[pos][0] = i;
stencilxyz[pos][1] = j;
stencilxyz[pos][2] = 0;
stencil[pos++] = j*mbinx + i;
}
nstencil_ssa[2] = pos;
nstencil_ssa[3] = pos;
nstencil_ssa[4] = pos;
for (j = -sy; j < 0; j++)
for (i = 0; i <= sx; i++)
if (bin_distance(i,j,0) < cutneighmaxsq) {
stencilxyz[pos][0] = i;
stencilxyz[pos][1] = j;
stencilxyz[pos][2] = 0;
stencil[pos++] = j*mbinx + i;
}
for (j = -sy; j <= 0; j++)
for (i = -sx; i < 0; i++)
if (bin_distance(i,j,0) < cutneighmaxsq) {
stencilxyz[pos][0] = i;
stencilxyz[pos][1] = j;
stencilxyz[pos][2] = 0;
stencil[pos++] = j*mbinx + i;
}
nstencil = pos; }