remove evil tabs

This commit is contained in:
Axel Kohlmeyer
2021-08-19 10:06:34 -04:00
parent 11b4ae641f
commit 7046b75861
24 changed files with 412 additions and 412 deletions

View File

@ -591,8 +591,8 @@ void Fingerprint_bond::do3bodyfeatureset_doubleneighborloop(double * features,do
delz = zn[jj]; delz = zn[jj];
rsq = delx*delx + dely*dely + delz*delz; rsq = delx*delx + dely*dely + delz*delz;
if (rsq>rc*rc) { if (rsq>rc*rc) {
expr[jj][0]=0; expr[jj][0]=0;
continue; continue;
} }
double r1 = (rsq*((double)res)*cutinv2); double r1 = (rsq*((double)res)*cutinv2);
int m1 = (int)r1; int m1 = (int)r1;
@ -603,7 +603,7 @@ void Fingerprint_bond::do3bodyfeatureset_doubleneighborloop(double * features,do
double *p2 = &expcuttable[(m1+1)*kmax]; double *p2 = &expcuttable[(m1+1)*kmax];
double *p3 = &expcuttable[(m1+2)*kmax]; double *p3 = &expcuttable[(m1+2)*kmax];
for (kk=0;kk<kmax;kk++) { for (kk=0;kk<kmax;kk++) {
expr[jj][kk] = p1[kk]+0.5*r1*(p2[kk]-p0[kk]+r1*(2.0*p0[kk]-5.0*p1[kk]+4.0*p2[kk]-p3[kk]+r1*(3.0*(p1[kk]-p2[kk])+p3[kk]-p0[kk]))); expr[jj][kk] = p1[kk]+0.5*r1*(p2[kk]-p0[kk]+r1*(2.0*p0[kk]-5.0*p1[kk]+4.0*p2[kk]-p3[kk]+r1*(3.0*(p1[kk]-p2[kk])+p3[kk]-p0[kk])));
} }
double* q = &dfctable[m1-1]; double* q = &dfctable[m1-1];
double* r2 = &rinvsqrttable[m1-1]; double* r2 = &rinvsqrttable[m1-1];

View File

@ -627,16 +627,16 @@ void Fingerprint_bondscreened::do3bodyfeatureset_doubleneighborloop(double * fea
if (Bij[jj]==false) {continue;} if (Bij[jj]==false) {continue;}
jtype = tn[jj]; jtype = tn[jj];
if (jtypes != nelements && jtypes != jtype && ktypes != nelements && ktypes != jtype) { if (jtypes != nelements && jtypes != jtype && ktypes != nelements && ktypes != jtype) {
expr[jj][0]=0; expr[jj][0]=0;
continue; continue;
} }
delx = xn[jj]; delx = xn[jj];
dely = yn[jj]; dely = yn[jj];
delz = zn[jj]; delz = zn[jj];
rsq = delx*delx + dely*dely + delz*delz; rsq = delx*delx + dely*dely + delz*delz;
if (rsq>rc*rc) { if (rsq>rc*rc) {
expr[jj][0]=0; expr[jj][0]=0;
continue; continue;
} }
double r1 = (rsq*((double)res)*cutinv2); double r1 = (rsq*((double)res)*cutinv2);
int m1 = (int)r1; int m1 = (int)r1;
@ -647,8 +647,8 @@ void Fingerprint_bondscreened::do3bodyfeatureset_doubleneighborloop(double * fea
double *p2 = &expcuttable[(m1+1)*kmax]; double *p2 = &expcuttable[(m1+1)*kmax];
double *p3 = &expcuttable[(m1+2)*kmax]; double *p3 = &expcuttable[(m1+2)*kmax];
for (kk=0;kk<kmax;kk++) { for (kk=0;kk<kmax;kk++) {
expr[jj][kk] = p1[kk]+0.5*r1*(p2[kk]-p0[kk]+r1*(2.0*p0[kk]-5.0*p1[kk]+4.0*p2[kk]-p3[kk]+r1*(3.0*(p1[kk]-p2[kk])+p3[kk]-p0[kk]))); expr[jj][kk] = p1[kk]+0.5*r1*(p2[kk]-p0[kk]+r1*(2.0*p0[kk]-5.0*p1[kk]+4.0*p2[kk]-p3[kk]+r1*(3.0*(p1[kk]-p2[kk])+p3[kk]-p0[kk])));
expr[jj][kk] *= Sik[jj]; expr[jj][kk] *= Sik[jj];
} }
double* q = &dfctable[m1-1]; double* q = &dfctable[m1-1];
double* r2 = &rinvsqrttable[m1-1]; double* r2 = &rinvsqrttable[m1-1];

View File

@ -100,7 +100,7 @@ void NPairFullMultiOmp::build(NeighList *list)
// if same collection use own bin // if same collection use own bin
if (icollection == jcollection) jbin = ibin; if (icollection == jcollection) jbin = ibin;
else jbin = coord2bin(x[i], jcollection); else jbin = coord2bin(x[i], jcollection);
// loop over all atoms in surrounding bins in stencil including self // loop over all atoms in surrounding bins in stencil including self
// skip i = j // skip i = j
@ -110,34 +110,34 @@ void NPairFullMultiOmp::build(NeighList *list)
ns = nstencil_multi[icollection][jcollection]; ns = nstencil_multi[icollection][jcollection];
for (k = 0; k < ns; k++) { for (k = 0; k < ns; k++) {
js = binhead_multi[jcollection][jbin + s[k]]; js = binhead_multi[jcollection][jbin + s[k]];
for (j = js; j >= 0; j = bins[j]) { for (j = js; j >= 0; j = bins[j]) {
if (i == j) continue; if (i == j) continue;
jtype = type[j]; jtype = type[j];
if (exclude && exclusion(i,j,itype,jtype,mask,molecule)) continue; if (exclude && exclusion(i,j,itype,jtype,mask,molecule)) continue;
delx = xtmp - x[j][0]; delx = xtmp - x[j][0];
dely = ytmp - x[j][1]; dely = ytmp - x[j][1];
delz = ztmp - x[j][2]; delz = ztmp - x[j][2];
rsq = delx*delx + dely*dely + delz*delz; rsq = delx*delx + dely*dely + delz*delz;
if (rsq <= cutneighsq[itype][jtype]) { if (rsq <= cutneighsq[itype][jtype]) {
if (molecular != Atom::ATOMIC) { if (molecular != Atom::ATOMIC) {
if (!moltemplate) if (!moltemplate)
which = find_special(special[i],nspecial[i],tag[j]); which = find_special(special[i],nspecial[i],tag[j]);
else if (imol >= 0) else if (imol >= 0)
which = find_special(onemols[imol]->special[iatom], which = find_special(onemols[imol]->special[iatom],
onemols[imol]->nspecial[iatom], onemols[imol]->nspecial[iatom],
tag[j]-tagprev); tag[j]-tagprev);
else which = 0; else which = 0;
if (which == 0) neighptr[n++] = j; if (which == 0) neighptr[n++] = j;
else if (domain->minimum_image_check(delx,dely,delz)) else if (domain->minimum_image_check(delx,dely,delz))
neighptr[n++] = j; neighptr[n++] = j;
else if (which > 0) neighptr[n++] = j ^ (which << SBBITS); else if (which > 0) neighptr[n++] = j ^ (which << SBBITS);
} else neighptr[n++] = j; } else neighptr[n++] = j;
} }
} }
} }
} }

View File

@ -102,7 +102,7 @@ void NPairHalfMultiNewtoffOmp::build(NeighList *list)
// if same collection use own bin // if same collection use own bin
if (icollection == jcollection) jbin = ibin; if (icollection == jcollection) jbin = ibin;
else jbin = coord2bin(x[i], jcollection); else jbin = coord2bin(x[i], jcollection);
// loop over all atoms in other bins in stencil including self // loop over all atoms in other bins in stencil including self
// only store pair if i < j // only store pair if i < j
@ -114,16 +114,16 @@ void NPairHalfMultiNewtoffOmp::build(NeighList *list)
ns = nstencil_multi[icollection][jcollection]; ns = nstencil_multi[icollection][jcollection];
for (k = 0; k < ns; k++) { for (k = 0; k < ns; k++) {
js = binhead_multi[jcollection][jbin + s[k]]; js = binhead_multi[jcollection][jbin + s[k]];
for (j = js; j >= 0; j = bins[j]) { for (j = js; j >= 0; j = bins[j]) {
if (j <= i) continue; if (j <= i) continue;
jtype = type[j]; jtype = type[j];
if (exclude && exclusion(i,j,itype,jtype,mask,molecule)) continue; if (exclude && exclusion(i,j,itype,jtype,mask,molecule)) continue;
delx = xtmp - x[j][0]; delx = xtmp - x[j][0];
dely = ytmp - x[j][1]; dely = ytmp - x[j][1];
delz = ztmp - x[j][2]; delz = ztmp - x[j][2];
rsq = delx*delx + dely*dely + delz*delz; rsq = delx*delx + dely*dely + delz*delz;
if (rsq <= cutneighsq[itype][jtype]) { if (rsq <= cutneighsq[itype][jtype]) {

View File

@ -101,7 +101,7 @@ void NPairHalfMultiNewtonOmp::build(NeighList *list)
// if same collection use own bin // if same collection use own bin
if (icollection == jcollection) jbin = ibin; if (icollection == jcollection) jbin = ibin;
else jbin = coord2bin(x[i], jcollection); else jbin = coord2bin(x[i], jcollection);
// if same size: uses half stencil so check central bin // if same size: uses half stencil so check central bin
if (cutcollectionsq[icollection][icollection] == cutcollectionsq[jcollection][jcollection]){ if (cutcollectionsq[icollection][icollection] == cutcollectionsq[jcollection][jcollection]){
@ -117,41 +117,41 @@ void NPairHalfMultiNewtonOmp::build(NeighList *list)
// if j is owned atom, store it if j > i // if j is owned atom, store it if j > i
// if j is ghost, only store if j coords are "above and to the right" of i // if j is ghost, only store if j coords are "above and to the right" of i
for (j = js; j >= 0; j = bins[j]) { for (j = js; j >= 0; j = bins[j]) {
if ((icollection != jcollection) && (j < i)) continue; if ((icollection != jcollection) && (j < i)) continue;
if (j >= nlocal) { if (j >= nlocal) {
if (x[j][2] < ztmp) continue; if (x[j][2] < ztmp) continue;
if (x[j][2] == ztmp) { if (x[j][2] == ztmp) {
if (x[j][1] < ytmp) continue; if (x[j][1] < ytmp) continue;
if (x[j][1] == ytmp && x[j][0] < xtmp) continue; if (x[j][1] == ytmp && x[j][0] < xtmp) continue;
} }
} }
jtype = type[j]; jtype = type[j];
if (exclude && exclusion(i,j,itype,jtype,mask,molecule)) continue; if (exclude && exclusion(i,j,itype,jtype,mask,molecule)) continue;
delx = xtmp - x[j][0]; delx = xtmp - x[j][0];
dely = ytmp - x[j][1]; dely = ytmp - x[j][1];
delz = ztmp - x[j][2]; delz = ztmp - x[j][2];
rsq = delx*delx + dely*dely + delz*delz; rsq = delx*delx + dely*dely + delz*delz;
if (rsq <= cutneighsq[itype][jtype]) { if (rsq <= cutneighsq[itype][jtype]) {
if (molecular) { if (molecular) {
if (!moltemplate) if (!moltemplate)
which = find_special(special[i],nspecial[i],tag[j]); which = find_special(special[i],nspecial[i],tag[j]);
else if (imol >= 0) else if (imol >= 0)
which = find_special(onemols[imol]->special[iatom], which = find_special(onemols[imol]->special[iatom],
onemols[imol]->nspecial[iatom], onemols[imol]->nspecial[iatom],
tag[j]-tagprev); tag[j]-tagprev);
else which = 0; else which = 0;
if (which == 0) neighptr[n++] = j; if (which == 0) neighptr[n++] = j;
else if (domain->minimum_image_check(delx,dely,delz)) else if (domain->minimum_image_check(delx,dely,delz))
neighptr[n++] = j; neighptr[n++] = j;
else if (which > 0) neighptr[n++] = j ^ (which << SBBITS); else if (which > 0) neighptr[n++] = j ^ (which << SBBITS);
} else neighptr[n++] = j; } else neighptr[n++] = j;
} }
} }
} }
// for all collections, loop over all atoms in other bins in stencil, store every pair // for all collections, loop over all atoms in other bins in stencil, store every pair
@ -159,38 +159,38 @@ void NPairHalfMultiNewtonOmp::build(NeighList *list)
// stencil is half if i same size as j // stencil is half if i same size as j
// stencil is full if i smaller than j // stencil is full if i smaller than j
s = stencil_multi[icollection][jcollection]; s = stencil_multi[icollection][jcollection];
ns = nstencil_multi[icollection][jcollection]; ns = nstencil_multi[icollection][jcollection];
for (k = 0; k < ns; k++) { for (k = 0; k < ns; k++) {
js = binhead_multi[jcollection][jbin + s[k]]; js = binhead_multi[jcollection][jbin + s[k]];
for (j = js; j >= 0; j = bins[j]) { for (j = js; j >= 0; j = bins[j]) {
jtype = type[j]; jtype = type[j];
if (exclude && exclusion(i,j,itype,jtype,mask,molecule)) continue; if (exclude && exclusion(i,j,itype,jtype,mask,molecule)) continue;
delx = xtmp - x[j][0]; delx = xtmp - x[j][0];
dely = ytmp - x[j][1]; dely = ytmp - x[j][1];
delz = ztmp - x[j][2]; delz = ztmp - x[j][2];
rsq = delx*delx + dely*dely + delz*delz; rsq = delx*delx + dely*dely + delz*delz;
if (rsq <= cutneighsq[itype][jtype]) { if (rsq <= cutneighsq[itype][jtype]) {
if (molecular != Atom::ATOMIC) { if (molecular != Atom::ATOMIC) {
if (!moltemplate) if (!moltemplate)
which = find_special(special[i],nspecial[i],tag[j]); which = find_special(special[i],nspecial[i],tag[j]);
else if (imol >= 0) else if (imol >= 0)
which = find_special(onemols[imol]->special[iatom], which = find_special(onemols[imol]->special[iatom],
onemols[imol]->nspecial[iatom], onemols[imol]->nspecial[iatom],
tag[j]-tagprev); tag[j]-tagprev);
else which = 0; else which = 0;
if (which == 0) neighptr[n++] = j; if (which == 0) neighptr[n++] = j;
else if (domain->minimum_image_check(delx,dely,delz)) else if (domain->minimum_image_check(delx,dely,delz))
neighptr[n++] = j; neighptr[n++] = j;
else if (which > 0) neighptr[n++] = j ^ (which << SBBITS); else if (which > 0) neighptr[n++] = j ^ (which << SBBITS);
} else neighptr[n++] = j; } else neighptr[n++] = j;
} }
} }
} }
} }
ilist[i] = i; ilist[i] = i;

View File

@ -102,7 +102,7 @@ void NPairHalfMultiNewtonTriOmp::build(NeighList *list)
// if same collection use own bin // if same collection use own bin
if (icollection == jcollection) jbin = ibin; if (icollection == jcollection) jbin = ibin;
else jbin = coord2bin(x[i], jcollection); else jbin = coord2bin(x[i], jcollection);
// loop over all atoms in bins in stencil // loop over all atoms in bins in stencil
// stencil is empty if i larger than j // stencil is empty if i larger than j
@ -113,12 +113,12 @@ void NPairHalfMultiNewtonTriOmp::build(NeighList *list)
// (equal zyx and j <= i) // (equal zyx and j <= i)
// latter excludes self-self interaction but allows superposed atoms // latter excludes self-self interaction but allows superposed atoms
s = stencil_multi[icollection][jcollection]; s = stencil_multi[icollection][jcollection];
ns = nstencil_multi[icollection][jcollection]; ns = nstencil_multi[icollection][jcollection];
for (k = 0; k < ns; k++) { for (k = 0; k < ns; k++) {
js = binhead_multi[jcollection][jbin + s[k]]; js = binhead_multi[jcollection][jbin + s[k]];
for (j = js; j >= 0; j = bins[j]) { for (j = js; j >= 0; j = bins[j]) {
// if same size (same collection), use half stencil // if same size (same collection), use half stencil
if (cutcollectionsq[icollection][icollection] == cutcollectionsq[jcollection][jcollection]){ if (cutcollectionsq[icollection][icollection] == cutcollectionsq[jcollection][jcollection]){
@ -133,30 +133,30 @@ void NPairHalfMultiNewtonTriOmp::build(NeighList *list)
} }
jtype = type[j]; jtype = type[j];
if (exclude && exclusion(i,j,itype,jtype,mask,molecule)) continue; if (exclude && exclusion(i,j,itype,jtype,mask,molecule)) continue;
delx = xtmp - x[j][0]; delx = xtmp - x[j][0];
dely = ytmp - x[j][1]; dely = ytmp - x[j][1];
delz = ztmp - x[j][2]; delz = ztmp - x[j][2];
rsq = delx*delx + dely*dely + delz*delz; rsq = delx*delx + dely*dely + delz*delz;
if (rsq <= cutneighsq[itype][jtype]) { if (rsq <= cutneighsq[itype][jtype]) {
if (molecular != Atom::ATOMIC) { if (molecular != Atom::ATOMIC) {
if (!moltemplate) if (!moltemplate)
which = find_special(special[i],nspecial[i],tag[j]); which = find_special(special[i],nspecial[i],tag[j]);
else if (imol >= 0) else if (imol >= 0)
which = find_special(onemols[imol]->special[iatom], which = find_special(onemols[imol]->special[iatom],
onemols[imol]->nspecial[iatom], onemols[imol]->nspecial[iatom],
tag[j]-tagprev); tag[j]-tagprev);
else which = 0; else which = 0;
if (which == 0) neighptr[n++] = j; if (which == 0) neighptr[n++] = j;
else if (domain->minimum_image_check(delx,dely,delz)) else if (domain->minimum_image_check(delx,dely,delz))
neighptr[n++] = j; neighptr[n++] = j;
else if (which > 0) neighptr[n++] = j ^ (which << SBBITS); else if (which > 0) neighptr[n++] = j ^ (which << SBBITS);
} else neighptr[n++] = j; } else neighptr[n++] = j;
} }
} }
} }
} }
ilist[i] = i; ilist[i] = i;

View File

@ -92,7 +92,7 @@ void NPairHalfSizeMultiNewtoffOmp::build(NeighList *list)
// if same collection use own bin // if same collection use own bin
if(icollection == jcollection) jbin = ibin; if(icollection == jcollection) jbin = ibin;
else jbin = coord2bin(x[i], jcollection); else jbin = coord2bin(x[i], jcollection);
// loop over all atoms in other bins in stencil including self // loop over all atoms in other bins in stencil including self
// only store pair if i < j // only store pair if i < j
@ -104,27 +104,27 @@ void NPairHalfSizeMultiNewtoffOmp::build(NeighList *list)
ns = nstencil_multi[icollection][jcollection]; ns = nstencil_multi[icollection][jcollection];
for (k = 0; k < ns; k++) { for (k = 0; k < ns; k++) {
js = binhead_multi[jcollection][jbin + s[k]]; js = binhead_multi[jcollection][jbin + s[k]];
for (j = js; j >=0; j = bins[j]) { for (j = js; j >=0; j = bins[j]) {
if (j <= i) continue; if (j <= i) continue;
jtype = type[j]; jtype = type[j];
if (exclude && exclusion(i,j,itype,jtype,mask,molecule)) continue; if (exclude && exclusion(i,j,itype,jtype,mask,molecule)) continue;
delx = xtmp - x[j][0]; delx = xtmp - x[j][0];
dely = ytmp - x[j][1]; dely = ytmp - x[j][1];
delz = ztmp - x[j][2]; delz = ztmp - x[j][2];
rsq = delx*delx + dely*dely + delz*delz; rsq = delx*delx + dely*dely + delz*delz;
radsum = radi + radius[j]; radsum = radi + radius[j];
cutdistsq = (radsum+skin) * (radsum+skin); cutdistsq = (radsum+skin) * (radsum+skin);
if (rsq <= cutdistsq) { if (rsq <= cutdistsq) {
if (history && rsq < radsum*radsum) if (history && rsq < radsum*radsum)
neighptr[n++] = j ^ mask_history; neighptr[n++] = j ^ mask_history;
else else
neighptr[n++] = j; neighptr[n++] = j;
} }
} }
} }
} }

View File

@ -91,7 +91,7 @@ void NPairHalfSizeMultiNewtonOmp::build(NeighList *list)
// if same collection use own bin // if same collection use own bin
if(icollection == jcollection) jbin = ibin; if(icollection == jcollection) jbin = ibin;
else jbin = coord2bin(x[i], jcollection); else jbin = coord2bin(x[i], jcollection);
// if same size: uses half stencil so check central bin // if same size: uses half stencil so check central bin
if(cutcollectionsq[icollection][icollection] == cutcollectionsq[jcollection][jcollection]){ if(cutcollectionsq[icollection][icollection] == cutcollectionsq[jcollection][jcollection]){
@ -107,33 +107,33 @@ void NPairHalfSizeMultiNewtonOmp::build(NeighList *list)
// if j is owned atom, store it if j > i // if j is owned atom, store it if j > i
// if j is ghost, only store if j coords are "above and to the right" of i // if j is ghost, only store if j coords are "above and to the right" of i
for (j = js; j >= 0; j = bins[j]) { for (j = js; j >= 0; j = bins[j]) {
if(icollection != jcollection and j < i) continue; if(icollection != jcollection and j < i) continue;
if (j >= nlocal) { if (j >= nlocal) {
if (x[j][2] < ztmp) continue; if (x[j][2] < ztmp) continue;
if (x[j][2] == ztmp) { if (x[j][2] == ztmp) {
if (x[j][1] < ytmp) continue; if (x[j][1] < ytmp) continue;
if (x[j][1] == ytmp && x[j][0] < xtmp) continue; if (x[j][1] == ytmp && x[j][0] < xtmp) continue;
} }
} }
jtype = type[j]; jtype = type[j];
if (exclude && exclusion(i,j,itype,jtype,mask,molecule)) continue; if (exclude && exclusion(i,j,itype,jtype,mask,molecule)) continue;
delx = xtmp - x[j][0]; delx = xtmp - x[j][0];
dely = ytmp - x[j][1]; dely = ytmp - x[j][1];
delz = ztmp - x[j][2]; delz = ztmp - x[j][2];
rsq = delx*delx + dely*dely + delz*delz; rsq = delx*delx + dely*dely + delz*delz;
radsum = radi + radius[j]; radsum = radi + radius[j];
cutdistsq = (radsum+skin) * (radsum+skin); cutdistsq = (radsum+skin) * (radsum+skin);
if (rsq <= cutdistsq) { if (rsq <= cutdistsq) {
if (history && rsq < radsum*radsum) if (history && rsq < radsum*radsum)
neighptr[n++] = j ^ mask_history; neighptr[n++] = j ^ mask_history;
else else
neighptr[n++] = j; neighptr[n++] = j;
} }
} }
} }
@ -142,31 +142,31 @@ void NPairHalfSizeMultiNewtonOmp::build(NeighList *list)
// stencil is half if i same size as j // stencil is half if i same size as j
// stencil is full if i smaller than j // stencil is full if i smaller than j
s = stencil_multi[icollection][jcollection]; s = stencil_multi[icollection][jcollection];
ns = nstencil_multi[icollection][jcollection]; ns = nstencil_multi[icollection][jcollection];
for (k = 0; k < ns; k++) { for (k = 0; k < ns; k++) {
js = binhead_multi[jcollection][jbin + s[k]]; js = binhead_multi[jcollection][jbin + s[k]];
for (j = js; j >= 0; j = bins[j]) { for (j = js; j >= 0; j = bins[j]) {
jtype = type[j]; jtype = type[j];
if (exclude && exclusion(i,j,itype,jtype,mask,molecule)) continue; if (exclude && exclusion(i,j,itype,jtype,mask,molecule)) continue;
delx = xtmp - x[j][0]; delx = xtmp - x[j][0];
dely = ytmp - x[j][1]; dely = ytmp - x[j][1];
delz = ztmp - x[j][2]; delz = ztmp - x[j][2];
rsq = delx*delx + dely*dely + delz*delz; rsq = delx*delx + dely*dely + delz*delz;
radsum = radi + radius[j]; radsum = radi + radius[j];
cutdistsq = (radsum+skin) * (radsum+skin); cutdistsq = (radsum+skin) * (radsum+skin);
if (rsq <= cutdistsq) { if (rsq <= cutdistsq) {
if (history && rsq < radsum*radsum) if (history && rsq < radsum*radsum)
neighptr[n++] = j ^ mask_history; neighptr[n++] = j ^ mask_history;
else else
neighptr[n++] = j; neighptr[n++] = j;
} }
} }
} }
} }
ilist[i] = i; ilist[i] = i;

View File

@ -92,7 +92,7 @@ void NPairHalfSizeMultiNewtonTriOmp::build(NeighList *list)
// if same collection use own bin // if same collection use own bin
if(icollection == jcollection) jbin = ibin; if(icollection == jcollection) jbin = ibin;
else jbin = coord2bin(x[i], jcollection); else jbin = coord2bin(x[i], jcollection);
// loop over all atoms in bins in stencil // loop over all atoms in bins in stencil
@ -104,12 +104,12 @@ void NPairHalfSizeMultiNewtonTriOmp::build(NeighList *list)
// (equal zyx and j <= i) // (equal zyx and j <= i)
// latter excludes self-self interaction but allows superposed atoms // latter excludes self-self interaction but allows superposed atoms
s = stencil_multi[icollection][jcollection]; s = stencil_multi[icollection][jcollection];
ns = nstencil_multi[icollection][jcollection]; ns = nstencil_multi[icollection][jcollection];
for (k = 0; k < ns; k++) { for (k = 0; k < ns; k++) {
js = binhead_multi[jcollection][jbin + s[k]]; js = binhead_multi[jcollection][jbin + s[k]];
for (j = js; j >= 0; j = bins[j]) { for (j = js; j >= 0; j = bins[j]) {
// if same size (same collection), use half stencil // if same size (same collection), use half stencil
if(cutcollectionsq[icollection][icollection] == cutcollectionsq[jcollection][jcollection]){ if(cutcollectionsq[icollection][icollection] == cutcollectionsq[jcollection][jcollection]){
@ -126,21 +126,21 @@ void NPairHalfSizeMultiNewtonTriOmp::build(NeighList *list)
jtype = type[j]; jtype = type[j];
if (exclude && exclusion(i,j,itype,jtype,mask,molecule)) continue; if (exclude && exclusion(i,j,itype,jtype,mask,molecule)) continue;
delx = xtmp - x[j][0]; delx = xtmp - x[j][0];
dely = ytmp - x[j][1]; dely = ytmp - x[j][1];
delz = ztmp - x[j][2]; delz = ztmp - x[j][2];
rsq = delx*delx + dely*dely + delz*delz; rsq = delx*delx + dely*dely + delz*delz;
radsum = radi + radius[j]; radsum = radi + radius[j];
cutdistsq = (radsum+skin) * (radsum+skin); cutdistsq = (radsum+skin) * (radsum+skin);
if (rsq <= cutdistsq) { if (rsq <= cutdistsq) {
if (history && rsq < radsum*radsum) if (history && rsq < radsum*radsum)
neighptr[n++] = j ^ mask_history; neighptr[n++] = j ^ mask_history;
else else
neighptr[n++] = j; neighptr[n++] = j;
} }
} }
} }
} }
ilist[i] = i; ilist[i] = i;

View File

@ -202,7 +202,7 @@ void NBinMulti::setup_bins(int /*style*/)
// test for too many global bins in any dimension due to huge global domain // test for too many global bins in any dimension due to huge global domain
if (bbox[0]*binsizeinv > MAXSMALLINT || bbox[1]*binsizeinv > MAXSMALLINT || if (bbox[0]*binsizeinv > MAXSMALLINT || bbox[1]*binsizeinv > MAXSMALLINT ||
bbox[2]*binsizeinv > MAXSMALLINT) bbox[2]*binsizeinv > MAXSMALLINT)
error->all(FLERR,"Domain too large for neighbor bins"); error->all(FLERR,"Domain too large for neighbor bins");
// create actual bins // create actual bins
@ -233,7 +233,7 @@ void NBinMulti::setup_bins(int /*style*/)
bininvz_multi[n] = 1.0 / binsizez_multi[n]; bininvz_multi[n] = 1.0 / binsizez_multi[n];
if (binsize_optimal*bininvx_multi[n] > CUT2BIN_RATIO || if (binsize_optimal*bininvx_multi[n] > CUT2BIN_RATIO ||
binsize_optimal*bininvy_multi[n] > CUT2BIN_RATIO) binsize_optimal*bininvy_multi[n] > CUT2BIN_RATIO)
error->all(FLERR,"Cannot use neighbor bins - box size << cutoff"); error->all(FLERR,"Cannot use neighbor bins - box size << cutoff");
if ((dimension == 3) && (binsize_optimal*bininvz_multi[n] > CUT2BIN_RATIO)) if ((dimension == 3) && (binsize_optimal*bininvz_multi[n] > CUT2BIN_RATIO))
error->all(FLERR,"Cannot use neighbor bins - box size << cutoff"); error->all(FLERR,"Cannot use neighbor bins - box size << cutoff");

View File

@ -89,7 +89,7 @@ void NPairFullMulti::build(NeighList *list)
// if same collection use own bin // if same collection use own bin
if(icollection == jcollection) jbin = ibin; if(icollection == jcollection) jbin = ibin;
else jbin = coord2bin(x[i], jcollection); else jbin = coord2bin(x[i], jcollection);
// loop over all atoms in surrounding bins in stencil including self // loop over all atoms in surrounding bins in stencil including self
// skip i = j // skip i = j
@ -99,34 +99,34 @@ void NPairFullMulti::build(NeighList *list)
ns = nstencil_multi[icollection][jcollection]; ns = nstencil_multi[icollection][jcollection];
for (k = 0; k < ns; k++) { for (k = 0; k < ns; k++) {
js = binhead_multi[jcollection][jbin + s[k]]; js = binhead_multi[jcollection][jbin + s[k]];
for (j = js; j >= 0; j = bins[j]) { for (j = js; j >= 0; j = bins[j]) {
if (i == j) continue; if (i == j) continue;
jtype = type[j]; jtype = type[j];
if (exclude && exclusion(i,j,itype,jtype,mask,molecule)) continue; if (exclude && exclusion(i,j,itype,jtype,mask,molecule)) continue;
delx = xtmp - x[j][0]; delx = xtmp - x[j][0];
dely = ytmp - x[j][1]; dely = ytmp - x[j][1];
delz = ztmp - x[j][2]; delz = ztmp - x[j][2];
rsq = delx*delx + dely*dely + delz*delz; rsq = delx*delx + dely*dely + delz*delz;
if (rsq <= cutneighsq[itype][jtype]) { if (rsq <= cutneighsq[itype][jtype]) {
if (molecular != Atom::ATOMIC) { if (molecular != Atom::ATOMIC) {
if (!moltemplate) if (!moltemplate)
which = find_special(special[i],nspecial[i],tag[j]); which = find_special(special[i],nspecial[i],tag[j]);
else if (imol >= 0) else if (imol >= 0)
which = find_special(onemols[imol]->special[iatom], which = find_special(onemols[imol]->special[iatom],
onemols[imol]->nspecial[iatom], onemols[imol]->nspecial[iatom],
tag[j]-tagprev); tag[j]-tagprev);
else which = 0; else which = 0;
if (which == 0) neighptr[n++] = j; if (which == 0) neighptr[n++] = j;
else if (domain->minimum_image_check(delx,dely,delz)) else if (domain->minimum_image_check(delx,dely,delz))
neighptr[n++] = j; neighptr[n++] = j;
else if (which > 0) neighptr[n++] = j ^ (which << SBBITS); else if (which > 0) neighptr[n++] = j ^ (which << SBBITS);
} else neighptr[n++] = j; } else neighptr[n++] = j;
} }
} }
} }
} }

View File

@ -91,7 +91,7 @@ void NPairHalfMultiNewtoff::build(NeighList *list)
// if same collection use own bin // if same collection use own bin
if (icollection == jcollection) jbin = ibin; if (icollection == jcollection) jbin = ibin;
else jbin = coord2bin(x[i], jcollection); else jbin = coord2bin(x[i], jcollection);
// loop over all atoms in other bins in stencil including self // loop over all atoms in other bins in stencil including self
// only store pair if i < j // only store pair if i < j
@ -103,16 +103,16 @@ void NPairHalfMultiNewtoff::build(NeighList *list)
ns = nstencil_multi[icollection][jcollection]; ns = nstencil_multi[icollection][jcollection];
for (k = 0; k < ns; k++) { for (k = 0; k < ns; k++) {
js = binhead_multi[jcollection][jbin + s[k]]; js = binhead_multi[jcollection][jbin + s[k]];
for (j = js; j >= 0; j = bins[j]) { for (j = js; j >= 0; j = bins[j]) {
if (j <= i) continue; if (j <= i) continue;
jtype = type[j]; jtype = type[j];
if (exclude && exclusion(i,j,itype,jtype,mask,molecule)) continue; if (exclude && exclusion(i,j,itype,jtype,mask,molecule)) continue;
delx = xtmp - x[j][0]; delx = xtmp - x[j][0];
dely = ytmp - x[j][1]; dely = ytmp - x[j][1];
delz = ztmp - x[j][2]; delz = ztmp - x[j][2];
rsq = delx*delx + dely*dely + delz*delz; rsq = delx*delx + dely*dely + delz*delz;
if (rsq <= cutneighsq[itype][jtype]) { if (rsq <= cutneighsq[itype][jtype]) {

View File

@ -90,7 +90,7 @@ void NPairHalfMultiNewton::build(NeighList *list)
// if same collection use own bin // if same collection use own bin
if(icollection == jcollection) jbin = ibin; if(icollection == jcollection) jbin = ibin;
else jbin = coord2bin(x[i], jcollection); else jbin = coord2bin(x[i], jcollection);
// if same size: uses half stencil so check central bin // if same size: uses half stencil so check central bin
if(cutcollectionsq[icollection][icollection] == cutcollectionsq[jcollection][jcollection]){ if(cutcollectionsq[icollection][icollection] == cutcollectionsq[jcollection][jcollection]){
@ -106,41 +106,41 @@ void NPairHalfMultiNewton::build(NeighList *list)
// if j is owned atom, store it if j > i // if j is owned atom, store it if j > i
// if j is ghost, only store if j coords are "above and to the right" of i // if j is ghost, only store if j coords are "above and to the right" of i
for (j = js; j >= 0; j = bins[j]) { for (j = js; j >= 0; j = bins[j]) {
if((icollection != jcollection) && (j < i)) continue; if((icollection != jcollection) && (j < i)) continue;
if (j >= nlocal) { if (j >= nlocal) {
if (x[j][2] < ztmp) continue; if (x[j][2] < ztmp) continue;
if (x[j][2] == ztmp) { if (x[j][2] == ztmp) {
if (x[j][1] < ytmp) continue; if (x[j][1] < ytmp) continue;
if (x[j][1] == ytmp && x[j][0] < xtmp) continue; if (x[j][1] == ytmp && x[j][0] < xtmp) continue;
} }
} }
jtype = type[j]; jtype = type[j];
if (exclude && exclusion(i,j,itype,jtype,mask,molecule)) continue; if (exclude && exclusion(i,j,itype,jtype,mask,molecule)) continue;
delx = xtmp - x[j][0]; delx = xtmp - x[j][0];
dely = ytmp - x[j][1]; dely = ytmp - x[j][1];
delz = ztmp - x[j][2]; delz = ztmp - x[j][2];
rsq = delx*delx + dely*dely + delz*delz; rsq = delx*delx + dely*dely + delz*delz;
if (rsq <= cutneighsq[itype][jtype]) { if (rsq <= cutneighsq[itype][jtype]) {
if (molecular) { if (molecular) {
if (!moltemplate) if (!moltemplate)
which = find_special(special[i],nspecial[i],tag[j]); which = find_special(special[i],nspecial[i],tag[j]);
else if (imol >= 0) else if (imol >= 0)
which = find_special(onemols[imol]->special[iatom], which = find_special(onemols[imol]->special[iatom],
onemols[imol]->nspecial[iatom], onemols[imol]->nspecial[iatom],
tag[j]-tagprev); tag[j]-tagprev);
else which = 0; else which = 0;
if (which == 0) neighptr[n++] = j; if (which == 0) neighptr[n++] = j;
else if (domain->minimum_image_check(delx,dely,delz)) else if (domain->minimum_image_check(delx,dely,delz))
neighptr[n++] = j; neighptr[n++] = j;
else if (which > 0) neighptr[n++] = j ^ (which << SBBITS); else if (which > 0) neighptr[n++] = j ^ (which << SBBITS);
} else neighptr[n++] = j; } else neighptr[n++] = j;
} }
} }
} }
// for all collections, loop over all atoms in other bins in stencil, store every pair // for all collections, loop over all atoms in other bins in stencil, store every pair
@ -148,38 +148,38 @@ void NPairHalfMultiNewton::build(NeighList *list)
// stencil is half if i same size as j // stencil is half if i same size as j
// stencil is full if i smaller than j // stencil is full if i smaller than j
s = stencil_multi[icollection][jcollection]; s = stencil_multi[icollection][jcollection];
ns = nstencil_multi[icollection][jcollection]; ns = nstencil_multi[icollection][jcollection];
for (k = 0; k < ns; k++) { for (k = 0; k < ns; k++) {
js = binhead_multi[jcollection][jbin + s[k]]; js = binhead_multi[jcollection][jbin + s[k]];
for (j = js; j >= 0; j = bins[j]) { for (j = js; j >= 0; j = bins[j]) {
jtype = type[j]; jtype = type[j];
if (exclude && exclusion(i,j,itype,jtype,mask,molecule)) continue; if (exclude && exclusion(i,j,itype,jtype,mask,molecule)) continue;
delx = xtmp - x[j][0]; delx = xtmp - x[j][0];
dely = ytmp - x[j][1]; dely = ytmp - x[j][1];
delz = ztmp - x[j][2]; delz = ztmp - x[j][2];
rsq = delx*delx + dely*dely + delz*delz; rsq = delx*delx + dely*dely + delz*delz;
if (rsq <= cutneighsq[itype][jtype]) { if (rsq <= cutneighsq[itype][jtype]) {
if (molecular != Atom::ATOMIC) { if (molecular != Atom::ATOMIC) {
if (!moltemplate) if (!moltemplate)
which = find_special(special[i],nspecial[i],tag[j]); which = find_special(special[i],nspecial[i],tag[j]);
else if (imol >= 0) else if (imol >= 0)
which = find_special(onemols[imol]->special[iatom], which = find_special(onemols[imol]->special[iatom],
onemols[imol]->nspecial[iatom], onemols[imol]->nspecial[iatom],
tag[j]-tagprev); tag[j]-tagprev);
else which = 0; else which = 0;
if (which == 0) neighptr[n++] = j; if (which == 0) neighptr[n++] = j;
else if (domain->minimum_image_check(delx,dely,delz)) else if (domain->minimum_image_check(delx,dely,delz))
neighptr[n++] = j; neighptr[n++] = j;
else if (which > 0) neighptr[n++] = j ^ (which << SBBITS); else if (which > 0) neighptr[n++] = j ^ (which << SBBITS);
} else neighptr[n++] = j; } else neighptr[n++] = j;
} }
} }
} }
} }
ilist[inum++] = i; ilist[inum++] = i;

View File

@ -90,7 +90,7 @@ void NPairHalfMultiNewtonTri::build(NeighList *list)
// if same collection use own bin // if same collection use own bin
if (icollection == jcollection) jbin = ibin; if (icollection == jcollection) jbin = ibin;
else jbin = coord2bin(x[i], jcollection); else jbin = coord2bin(x[i], jcollection);
// loop over all atoms in bins in stencil // loop over all atoms in bins in stencil
// stencil is empty if i larger than j // stencil is empty if i larger than j
@ -101,12 +101,12 @@ void NPairHalfMultiNewtonTri::build(NeighList *list)
// (equal zyx and j <= i) // (equal zyx and j <= i)
// latter excludes self-self interaction but allows superposed atoms // latter excludes self-self interaction but allows superposed atoms
s = stencil_multi[icollection][jcollection]; s = stencil_multi[icollection][jcollection];
ns = nstencil_multi[icollection][jcollection]; ns = nstencil_multi[icollection][jcollection];
for (k = 0; k < ns; k++) { for (k = 0; k < ns; k++) {
js = binhead_multi[jcollection][jbin + s[k]]; js = binhead_multi[jcollection][jbin + s[k]];
for (j = js; j >= 0; j = bins[j]) { for (j = js; j >= 0; j = bins[j]) {
// if same size (same collection), use half stencil // if same size (same collection), use half stencil
if(cutcollectionsq[icollection][icollection] == cutcollectionsq[jcollection][jcollection]){ if(cutcollectionsq[icollection][icollection] == cutcollectionsq[jcollection][jcollection]){
@ -123,28 +123,28 @@ void NPairHalfMultiNewtonTri::build(NeighList *list)
jtype = type[j]; jtype = type[j];
if (exclude && exclusion(i,j,itype,jtype,mask,molecule)) continue; if (exclude && exclusion(i,j,itype,jtype,mask,molecule)) continue;
delx = xtmp - x[j][0]; delx = xtmp - x[j][0];
dely = ytmp - x[j][1]; dely = ytmp - x[j][1];
delz = ztmp - x[j][2]; delz = ztmp - x[j][2];
rsq = delx*delx + dely*dely + delz*delz; rsq = delx*delx + dely*dely + delz*delz;
if (rsq <= cutneighsq[itype][jtype]) { if (rsq <= cutneighsq[itype][jtype]) {
if (molecular != Atom::ATOMIC) { if (molecular != Atom::ATOMIC) {
if (!moltemplate) if (!moltemplate)
which = find_special(special[i],nspecial[i],tag[j]); which = find_special(special[i],nspecial[i],tag[j]);
else if (imol >= 0) else if (imol >= 0)
which = find_special(onemols[imol]->special[iatom], which = find_special(onemols[imol]->special[iatom],
onemols[imol]->nspecial[iatom], onemols[imol]->nspecial[iatom],
tag[j]-tagprev); tag[j]-tagprev);
else which = 0; else which = 0;
if (which == 0) neighptr[n++] = j; if (which == 0) neighptr[n++] = j;
else if (domain->minimum_image_check(delx,dely,delz)) else if (domain->minimum_image_check(delx,dely,delz))
neighptr[n++] = j; neighptr[n++] = j;
else if (which > 0) neighptr[n++] = j ^ (which << SBBITS); else if (which > 0) neighptr[n++] = j ^ (which << SBBITS);
} else neighptr[n++] = j; } else neighptr[n++] = j;
} }
} }
} }
} }
ilist[inum++] = i; ilist[inum++] = i;

View File

@ -81,7 +81,7 @@ void NPairHalfSizeMultiNewtoff::build(NeighList *list)
// if same collection use own bin // if same collection use own bin
if (icollection == jcollection) jbin = ibin; if (icollection == jcollection) jbin = ibin;
else jbin = coord2bin(x[i], jcollection); else jbin = coord2bin(x[i], jcollection);
// loop over all atoms in other bins in stencil including self // loop over all atoms in other bins in stencil including self
// only store pair if i < j // only store pair if i < j
@ -93,27 +93,27 @@ void NPairHalfSizeMultiNewtoff::build(NeighList *list)
ns = nstencil_multi[icollection][jcollection]; ns = nstencil_multi[icollection][jcollection];
for (k = 0; k < ns; k++) { for (k = 0; k < ns; k++) {
js = binhead_multi[jcollection][jbin + s[k]]; js = binhead_multi[jcollection][jbin + s[k]];
for (j = js; j >= 0; j = bins[j]) { for (j = js; j >= 0; j = bins[j]) {
if (j <= i) continue; if (j <= i) continue;
jtype = type[j]; jtype = type[j];
if (exclude && exclusion(i,j,itype,jtype,mask,molecule)) continue; if (exclude && exclusion(i,j,itype,jtype,mask,molecule)) continue;
delx = xtmp - x[j][0]; delx = xtmp - x[j][0];
dely = ytmp - x[j][1]; dely = ytmp - x[j][1];
delz = ztmp - x[j][2]; delz = ztmp - x[j][2];
rsq = delx*delx + dely*dely + delz*delz; rsq = delx*delx + dely*dely + delz*delz;
radsum = radi + radius[j]; radsum = radi + radius[j];
cutdistsq = (radsum+skin) * (radsum+skin); cutdistsq = (radsum+skin) * (radsum+skin);
if (rsq <= cutdistsq) { if (rsq <= cutdistsq) {
if (history && rsq < radsum*radsum) if (history && rsq < radsum*radsum)
neighptr[n++] = j ^ mask_history; neighptr[n++] = j ^ mask_history;
else else
neighptr[n++] = j; neighptr[n++] = j;
} }
} }
} }
} }

View File

@ -78,7 +78,7 @@ void NPairHalfSizeMultiNewton::build(NeighList *list)
// if same collection use own bin // if same collection use own bin
if (icollection == jcollection) jbin = ibin; if (icollection == jcollection) jbin = ibin;
else jbin = coord2bin(x[i], jcollection); else jbin = coord2bin(x[i], jcollection);
// if same size: uses half stencil so check central bin // if same size: uses half stencil so check central bin
if (cutcollectionsq[icollection][icollection] == cutcollectionsq[jcollection][jcollection]){ if (cutcollectionsq[icollection][icollection] == cutcollectionsq[jcollection][jcollection]){
@ -94,33 +94,33 @@ void NPairHalfSizeMultiNewton::build(NeighList *list)
// if j is owned atom, store it if j > i // if j is owned atom, store it if j > i
// if j is ghost, only store if j coords are "above and to the right" of i // if j is ghost, only store if j coords are "above and to the right" of i
for (j = js; j >= 0; j = bins[j]) { for (j = js; j >= 0; j = bins[j]) {
if ((icollection != jcollection) && (j < i)) continue; if ((icollection != jcollection) && (j < i)) continue;
if (j >= nlocal) { if (j >= nlocal) {
if (x[j][2] < ztmp) continue; if (x[j][2] < ztmp) continue;
if (x[j][2] == ztmp) { if (x[j][2] == ztmp) {
if (x[j][1] < ytmp) continue; if (x[j][1] < ytmp) continue;
if (x[j][1] == ytmp && x[j][0] < xtmp) continue; if (x[j][1] == ytmp && x[j][0] < xtmp) continue;
} }
} }
jtype = type[j]; jtype = type[j];
if (exclude && exclusion(i,j,itype,jtype,mask,molecule)) continue; if (exclude && exclusion(i,j,itype,jtype,mask,molecule)) continue;
delx = xtmp - x[j][0]; delx = xtmp - x[j][0];
dely = ytmp - x[j][1]; dely = ytmp - x[j][1];
delz = ztmp - x[j][2]; delz = ztmp - x[j][2];
rsq = delx*delx + dely*dely + delz*delz; rsq = delx*delx + dely*dely + delz*delz;
radsum = radi + radius[j]; radsum = radi + radius[j];
cutdistsq = (radsum+skin) * (radsum+skin); cutdistsq = (radsum+skin) * (radsum+skin);
if (rsq <= cutdistsq) { if (rsq <= cutdistsq) {
if (history && rsq < radsum*radsum) if (history && rsq < radsum*radsum)
neighptr[n++] = j ^ mask_history; neighptr[n++] = j ^ mask_history;
else else
neighptr[n++] = j; neighptr[n++] = j;
} }
} }
} }
@ -129,30 +129,30 @@ void NPairHalfSizeMultiNewton::build(NeighList *list)
// stencil is half if i same size as j // stencil is half if i same size as j
// stencil is full if i smaller than j // stencil is full if i smaller than j
s = stencil_multi[icollection][jcollection]; s = stencil_multi[icollection][jcollection];
ns = nstencil_multi[icollection][jcollection]; ns = nstencil_multi[icollection][jcollection];
for (k = 0; k < ns; k++) { for (k = 0; k < ns; k++) {
js = binhead_multi[jcollection][jbin + s[k]]; js = binhead_multi[jcollection][jbin + s[k]];
for (j = js; j >= 0; j = bins[j]) { for (j = js; j >= 0; j = bins[j]) {
jtype = type[j]; jtype = type[j];
if (exclude && exclusion(i,j,itype,jtype,mask,molecule)) continue; if (exclude && exclusion(i,j,itype,jtype,mask,molecule)) continue;
delx = xtmp - x[j][0]; delx = xtmp - x[j][0];
dely = ytmp - x[j][1]; dely = ytmp - x[j][1];
delz = ztmp - x[j][2]; delz = ztmp - x[j][2];
rsq = delx*delx + dely*dely + delz*delz; rsq = delx*delx + dely*dely + delz*delz;
radsum = radi + radius[j]; radsum = radi + radius[j];
cutdistsq = (radsum+skin) * (radsum+skin); cutdistsq = (radsum+skin) * (radsum+skin);
if (rsq <= cutdistsq) { if (rsq <= cutdistsq) {
if (history && rsq < radsum*radsum) if (history && rsq < radsum*radsum)
neighptr[n++] = j ^ mask_history; neighptr[n++] = j ^ mask_history;
else else
neighptr[n++] = j; neighptr[n++] = j;
} }
} }
} }
} }

View File

@ -78,7 +78,7 @@ void NPairHalfSizeMultiNewtonTri::build(NeighList *list)
// if same collection use own bin // if same collection use own bin
if (icollection == jcollection) jbin = ibin; if (icollection == jcollection) jbin = ibin;
else jbin = coord2bin(x[i], jcollection); else jbin = coord2bin(x[i], jcollection);
// loop over all atoms in bins in stencil // loop over all atoms in bins in stencil
// stencil is empty if i larger than j // stencil is empty if i larger than j
@ -89,12 +89,12 @@ void NPairHalfSizeMultiNewtonTri::build(NeighList *list)
// (equal zyx and j <= i) // (equal zyx and j <= i)
// latter excludes self-self interaction but allows superposed atoms // latter excludes self-self interaction but allows superposed atoms
s = stencil_multi[icollection][jcollection]; s = stencil_multi[icollection][jcollection];
ns = nstencil_multi[icollection][jcollection]; ns = nstencil_multi[icollection][jcollection];
for (k = 0; k < ns; k++) { for (k = 0; k < ns; k++) {
js = binhead_multi[jcollection][jbin + s[k]]; js = binhead_multi[jcollection][jbin + s[k]];
for (j = js; j >= 0; j = bins[j]) { for (j = js; j >= 0; j = bins[j]) {
// if same size (same collection), use half stencil // if same size (same collection), use half stencil
if (cutcollectionsq[icollection][icollection] == cutcollectionsq[jcollection][jcollection]){ if (cutcollectionsq[icollection][icollection] == cutcollectionsq[jcollection][jcollection]){
@ -111,21 +111,21 @@ void NPairHalfSizeMultiNewtonTri::build(NeighList *list)
jtype = type[j]; jtype = type[j];
if (exclude && exclusion(i,j,itype,jtype,mask,molecule)) continue; if (exclude && exclusion(i,j,itype,jtype,mask,molecule)) continue;
delx = xtmp - x[j][0]; delx = xtmp - x[j][0];
dely = ytmp - x[j][1]; dely = ytmp - x[j][1];
delz = ztmp - x[j][2]; delz = ztmp - x[j][2];
rsq = delx*delx + dely*dely + delz*delz; rsq = delx*delx + dely*dely + delz*delz;
radsum = radi + radius[j]; radsum = radi + radius[j];
cutdistsq = (radsum+skin) * (radsum+skin); cutdistsq = (radsum+skin) * (radsum+skin);
if (rsq <= cutdistsq) { if (rsq <= cutdistsq) {
if (history && rsq < radsum*radsum) if (history && rsq < radsum*radsum)
neighptr[n++] = j ^ mask_history; neighptr[n++] = j ^ mask_history;
else else
neighptr[n++] = j; neighptr[n++] = j;
} }
} }
} }
} }
ilist[inum++] = i; ilist[inum++] = i;

View File

@ -335,7 +335,7 @@ void NStencil::create_setup()
for (i = 0; i < n; ++i) { for (i = 0; i < n; ++i) {
stencil_multi[i] = new int*[n](); stencil_multi[i] = new int*[n]();
for (j = 0; j < n; ++j) { for (j = 0; j < n; ++j) {
maxstencil_multi[i][j] = 0; maxstencil_multi[i][j] = 0;
nstencil_multi[i][j] = 0; nstencil_multi[i][j] = 0;
stencil_multi[i][j] = nullptr; stencil_multi[i][j] = nullptr;
} }
@ -390,7 +390,7 @@ void NStencil::create_setup()
if(stencil_multi[i][j]) if(stencil_multi[i][j])
memory->destroy(stencil_multi[i][j]); memory->destroy(stencil_multi[i][j]);
memory->create(stencil_multi[i][j], smax, memory->create(stencil_multi[i][j], smax,
"neighstencil::stencil_multi"); "neighstencil::stencil_multi");
} }
} }
} }

View File

@ -77,7 +77,7 @@ void NStencilFullMulti2d::create()
for (j = -sy; j <= sy; j++) for (j = -sy; j <= sy; j++)
for (i = -sx; i <= sx; i++) for (i = -sx; i <= sx; i++)
if (bin_distance_multi(i,j,0,bin_collection) < cutsq) if (bin_distance_multi(i,j,0,bin_collection) < cutsq)
stencil_multi[icollection][jcollection][ns++] = j*mbinx + i; stencil_multi[icollection][jcollection][ns++] = j*mbinx + i;
nstencil_multi[icollection][jcollection] = ns; nstencil_multi[icollection][jcollection] = ns;
} }

View File

@ -80,8 +80,8 @@ void NStencilFullMulti3d::create()
for (k = -sz; k <= sz; k++) for (k = -sz; k <= sz; k++)
for (j = -sy; j <= sy; j++) for (j = -sy; j <= sy; j++)
for (i = -sx; i <= sx; i++) for (i = -sx; i <= sx; i++)
if (bin_distance_multi(i,j,k,bin_collection) < cutsq) if (bin_distance_multi(i,j,k,bin_collection) < cutsq)
stencil_multi[icollection][jcollection][ns++] = stencil_multi[icollection][jcollection][ns++] =
k*mbiny*mbinx + j*mbinx + i; k*mbiny*mbinx + j*mbinx + i;
nstencil_multi[icollection][jcollection] = ns; nstencil_multi[icollection][jcollection] = ns;

View File

@ -92,12 +92,12 @@ void NStencilHalfMulti2d::create()
if (j > 0 || (j == 0 && i > 0)) { if (j > 0 || (j == 0 && i > 0)) {
if (bin_distance_multi(i,j,0,bin_collection) < cutsq) if (bin_distance_multi(i,j,0,bin_collection) < cutsq)
stencil_multi[icollection][jcollection][ns++] = j*mbinx + i; stencil_multi[icollection][jcollection][ns++] = j*mbinx + i;
} }
} else { } else {
for (j = -sy; j <= sy; j++) for (j = -sy; j <= sy; j++)
for (i = -sx; i <= sx; i++) for (i = -sx; i <= sx; i++)
if (bin_distance_multi(i,j,0,bin_collection) < cutsq) if (bin_distance_multi(i,j,0,bin_collection) < cutsq)
stencil_multi[icollection][jcollection][ns++] = j*mbinx + i; stencil_multi[icollection][jcollection][ns++] = j*mbinx + i;
} }
nstencil_multi[icollection][jcollection] = ns; nstencil_multi[icollection][jcollection] = ns;

View File

@ -90,12 +90,12 @@ void NStencilHalfMulti2dTri::create()
for (j = 0; j <= sy; j++) for (j = 0; j <= sy; j++)
for (i = -sx; i <= sx; i++) for (i = -sx; i <= sx; i++)
if (bin_distance_multi(i,j,0,bin_collection) < cutsq) if (bin_distance_multi(i,j,0,bin_collection) < cutsq)
stencil_multi[icollection][jcollection][ns++] = j*mbinx + i; stencil_multi[icollection][jcollection][ns++] = j*mbinx + i;
} else { } else {
for (j = -sy; j <= sy; j++) for (j = -sy; j <= sy; j++)
for (i = -sx; i <= sx; i++) for (i = -sx; i <= sx; i++)
if (bin_distance_multi(i,j,0,bin_collection) < cutsq) if (bin_distance_multi(i,j,0,bin_collection) < cutsq)
stencil_multi[icollection][jcollection][ns++] = j*mbinx + i; stencil_multi[icollection][jcollection][ns++] = j*mbinx + i;
} }
nstencil_multi[icollection][jcollection] = ns; nstencil_multi[icollection][jcollection] = ns;

View File

@ -92,17 +92,17 @@ void NStencilHalfMulti3d::create()
for (k = 0; k <= sz; k++) for (k = 0; k <= sz; k++)
for (j = -sy; j <= sy; j++) for (j = -sy; j <= sy; j++)
for (i = -sx; i <= sx; i++) for (i = -sx; i <= sx; i++)
if (k > 0 || j > 0 || (j == 0 && i > 0)) { if (k > 0 || j > 0 || (j == 0 && i > 0)) {
if (bin_distance_multi(i,j,k,bin_collection) < cutsq) if (bin_distance_multi(i,j,k,bin_collection) < cutsq)
stencil_multi[icollection][jcollection][ns++] = stencil_multi[icollection][jcollection][ns++] =
k*mbiny*mbinx + j*mbinx + i; k*mbiny*mbinx + j*mbinx + i;
} }
} else { } else {
for (k = -sz; k <= sz; k++) for (k = -sz; k <= sz; k++)
for (j = -sy; j <= sy; j++) for (j = -sy; j <= sy; j++)
for (i = -sx; i <= sx; i++) for (i = -sx; i <= sx; i++)
if (bin_distance_multi(i,j,k,bin_collection) < cutsq) if (bin_distance_multi(i,j,k,bin_collection) < cutsq)
stencil_multi[icollection][jcollection][ns++] = stencil_multi[icollection][jcollection][ns++] =
k*mbiny*mbinx + j*mbinx + i; k*mbiny*mbinx + j*mbinx + i;
} }

View File

@ -93,14 +93,14 @@ void NStencilHalfMulti3dTri::create()
for (j = -sy; j <= sy; j++) for (j = -sy; j <= sy; j++)
for (i = -sx; i <= sx; i++) for (i = -sx; i <= sx; i++)
if (bin_distance_multi(i,j,k,bin_collection) < cutsq) if (bin_distance_multi(i,j,k,bin_collection) < cutsq)
stencil_multi[icollection][jcollection][ns++] = stencil_multi[icollection][jcollection][ns++] =
k*mbiny*mbinx + j*mbinx + i; k*mbiny*mbinx + j*mbinx + i;
} else { } else {
for (k = -sz; k <= sz; k++) for (k = -sz; k <= sz; k++)
for (j = -sy; j <= sy; j++) for (j = -sy; j <= sy; j++)
for (i = -sx; i <= sx; i++) for (i = -sx; i <= sx; i++)
if (bin_distance_multi(i,j,k,bin_collection) < cutsq) if (bin_distance_multi(i,j,k,bin_collection) < cutsq)
stencil_multi[icollection][jcollection][ns++] = stencil_multi[icollection][jcollection][ns++] =
k*mbiny*mbinx + j*mbinx + i; k*mbiny*mbinx + j*mbinx + i;
} }