Adding files for BPM

This commit is contained in:
Joel Thomas Clemmer
2021-08-27 09:22:56 -06:00
parent 3404920e98
commit bb720626e3
87 changed files with 5392 additions and 905 deletions

View File

@ -15,7 +15,10 @@
#include "npair_half_size_nsq_newtoff.h"
#include "atom.h"
#include "atom_vec.h"
#include "domain.h"
#include "error.h"
#include "molecule.h"
#include "group.h"
#include "my_page.h"
#include "neigh_list.h"
@ -35,7 +38,8 @@ NPairHalfSizeNsqNewtoff::NPairHalfSizeNsqNewtoff(LAMMPS *lmp) : NPair(lmp) {}
void NPairHalfSizeNsqNewtoff::build(NeighList *list)
{
int i,j,n,bitmask;
int i,j,jh,n,bitmask,which,imol,iatom,moltemplate;
tagint tagprev;
double xtmp,ytmp,ztmp,delx,dely,delz,rsq;
double radi,radsum,cutsq;
int *neighptr;
@ -44,7 +48,10 @@ void NPairHalfSizeNsqNewtoff::build(NeighList *list)
double *radius = atom->radius;
int *type = atom->type;
int *mask = atom->mask;
tagint *tag = atom->tag;
tagint *molecule = atom->molecule;
tagint **special = atom->special;
int **nspecial = atom->nspecial;
int nlocal = atom->nlocal;
int nall = nlocal + atom->nghost;
if (includegroup) {
@ -52,13 +59,19 @@ void NPairHalfSizeNsqNewtoff::build(NeighList *list)
bitmask = group->bitmask[includegroup];
}
int *molindex = atom->molindex;
int *molatom = atom->molatom;
Molecule **onemols = atom->avec->onemols;
if (molecular == Atom::TEMPLATE) moltemplate = 1;
else moltemplate = 0;
int history = list->history;
int *ilist = list->ilist;
int *numneigh = list->numneigh;
int **firstneigh = list->firstneigh;
MyPage<int> *ipage = list->ipage;
int mask_history = 3 << SBBITS;
int mask_history = 1 << HISTBITS;
int inum = 0;
ipage->reset();
@ -71,6 +84,11 @@ void NPairHalfSizeNsqNewtoff::build(NeighList *list)
ytmp = x[i][1];
ztmp = x[i][2];
radi = radius[i];
if (moltemplate) {
imol = molindex[i];
iatom = molatom[i];
tagprev = tag[i] - iatom - 1;
}
// loop over remaining atoms, owned and ghost
@ -86,10 +104,24 @@ void NPairHalfSizeNsqNewtoff::build(NeighList *list)
cutsq = (radsum+skin) * (radsum+skin);
if (rsq <= cutsq) {
jh = j;
if (history && rsq < radsum*radsum)
neighptr[n++] = j ^ mask_history;
else
neighptr[n++] = j;
jh = jh ^ mask_history;
if (molecular != Atom::ATOMIC) {
if (!moltemplate)
which = find_special(special[i],nspecial[i],tag[j]);
else if (imol >= 0)
which = find_special(onemols[imol]->special[iatom],
onemols[imol]->nspecial[iatom],
tag[j]-tagprev);
else which = 0;
if (which == 0) neighptr[n++] = jh;
else if (domain->minimum_image_check(delx,dely,delz))
neighptr[n++] = jh;
else if (which > 0) neighptr[n++] = jh ^ (which << SBBITS);
// OLD: if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
} else neighptr[n++] = jh;
}
}