Renaming multi2->multi in nstencil

This commit is contained in:
Joel Clemmer
2020-12-19 17:45:46 -07:00
parent 1c52ff15c3
commit 5d097845e7
15 changed files with 200 additions and 200 deletions

View File

@ -0,0 +1,109 @@
/* ----------------------------------------------------------------------
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.
------------------------------------------------------------------------- */
#include "nstencil_half_multi_3d.h"
#include "neighbor.h"
#include "neigh_list.h"
#include "nbin.h"
#include "memory.h"
#include "atom.h"
#include <math.h>
using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
NStencilHalfMulti3d::NStencilHalfMulti3d(LAMMPS *lmp) :
NStencil(lmp) {}
/* ---------------------------------------------------------------------- */
void NStencilHalfMulti3d::set_stencil_properties()
{
int n = atom->ntypes;
int i, j;
// Cross types: use full stencil, looking one way through hierarchy
// smaller -> larger => use full stencil in larger bin
// larger -> smaller => no nstencil required
// If cut offs are same, use half stencil
for (i = 1; i <= n; i++) {
for (j = 1; j <= n; j++) {
if(cutneighsq[i][i] > cutneighsq[j][j]) continue;
stencil_skip[i][j] = 0;
if(cutneighsq[i][i] == cutneighsq[j][j]){
stencil_half[i][j] = 1;
stencil_bin_type[i][j] = i;
} else {
stencil_half[i][j] = 0;
stencil_bin_type[i][j] = j;
}
}
}
}
/* ----------------------------------------------------------------------
create stencils based on bin geometry and cutoff
------------------------------------------------------------------------- */
void NStencilHalfMulti3d::create()
{
int itype, jtype, bin_type, i, j, k, ns;
int n = atom->ntypes;
double cutsq;
for (itype = 1; itype <= n; itype++) {
for (jtype = 1; jtype <= n; jtype++) {
if (stencil_skip[itype][jtype]) continue;
ns = 0;
sx = stencil_sx_multi[itype][jtype];
sy = stencil_sy_multi[itype][jtype];
sz = stencil_sz_multi[itype][jtype];
mbinx = stencil_mbinx_multi[itype][jtype];
mbiny = stencil_mbiny_multi[itype][jtype];
mbinz = stencil_mbinz_multi[itype][jtype];
bin_type = stencil_bin_type[itype][jtype];
cutsq = cutneighsq[itype][jtype];
if (stencil_half[itype][jtype]) {
for (k = 0; k <= sz; k++)
for (j = -sy; j <= sy; j++)
for (i = -sx; i <= sx; i++)
if (k > 0 || j > 0 || (j == 0 && i > 0)) {
if (bin_distance_multi(i,j,k,bin_type) < cutsq)
stencil_multi[itype][jtype][ns++] =
k*mbiny*mbinx + j*mbinx + i;
}
} else {
for (k = -sz; k <= sz; k++)
for (j = -sy; j <= sy; j++)
for (i = -sx; i <= sx; i++)
if (bin_distance_multi(i,j,k,bin_type) < cutsq)
stencil_multi[itype][jtype][ns++] =
k*mbiny*mbinx + j*mbinx + i;
}
nstencil_multi[itype][jtype] = ns;
}
}
}