Adding collection array, new user arguments, and multi communication

This commit is contained in:
Joel Clemmer
2021-02-02 09:39:13 -07:00
parent 2c92737cd5
commit d79a2c3a02
51 changed files with 2109 additions and 697 deletions

View File

@ -12,6 +12,7 @@
------------------------------------------------------------------------- */
#include "npair_full_multi.h"
#include "neighbor.h"
#include "neigh_list.h"
#include "atom.h"
#include "atom_vec.h"
@ -28,18 +29,19 @@ NPairFullMulti::NPairFullMulti(LAMMPS *lmp) : NPair(lmp) {}
/* ----------------------------------------------------------------------
binned neighbor list construction for all neighbors
multi stencil is igroup-jgroup dependent
multi stencil is icollection-jcollection dependent
every neighbor pair appears in list of both atoms i and j
------------------------------------------------------------------------- */
void NPairFullMulti::build(NeighList *list)
{
int i,j,k,n,itype,jtype,igroup,jgroup,ibin,jbin,which,ns,imol,iatom,moltemplate;
int i,j,k,n,itype,jtype,icollection,jcollection,ibin,jbin,which,ns,imol,iatom,moltemplate;
tagint tagprev;
double xtmp,ytmp,ztmp,delx,dely,delz,rsq;
int *neighptr,*s;
int js;
int *collection = neighbor->collection;
double **x = atom->x;
int *type = atom->type;
int *mask = atom->mask;
@ -68,7 +70,7 @@ void NPairFullMulti::build(NeighList *list)
n = 0;
neighptr = ipage->vget();
itype = type[i];
igroup = map_type_multi[itype];
icollection = collection[i];
xtmp = x[i][0];
ytmp = x[i][1];
ztmp = x[i][2];
@ -80,22 +82,22 @@ void NPairFullMulti::build(NeighList *list)
ibin = atom2bin[i];
// loop through stencils for all groups
for (jgroup = 0; jgroup < n_multi_groups; jgroup++) {
// loop through stencils for all collections
for (jcollection = 0; jcollection < ncollections; jcollection++) {
// if same group use own bin
if(igroup == jgroup) jbin = ibin;
else jbin = coord2bin(x[i], jgroup);
// if same collection use own bin
if(icollection == jcollection) jbin = ibin;
else jbin = coord2bin(x[i], jcollection);
// loop over all atoms in surrounding bins in stencil including self
// skip i = j
// use full stencil for all group combinations
// use full stencil for all collection combinations
s = stencil_multi[igroup][jgroup];
ns = nstencil_multi[igroup][jgroup];
s = stencil_multi[icollection][jcollection];
ns = nstencil_multi[icollection][jcollection];
for (k = 0; k < ns; k++) {
js = binhead_multi[jgroup][jbin + s[k]];
js = binhead_multi[jcollection][jbin + s[k]];
for (j = js; j >= 0; j = bins[j]) {
if (i == j) continue;