Adding files for BPM
This commit is contained in:
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user