git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@8327 f3b2605a-c512-4ea7-a41b-209d697bcdaa

This commit is contained in:
sjplimp 2012-06-19 14:25:32 +00:00
parent 054feed381
commit 466dab27e4
5 changed files with 109 additions and 23 deletions

View File

@ -16,6 +16,7 @@
#include "neigh_list.h"
#include "atom.h"
#include "comm.h"
#include "domain.h"
#include "group.h"
#include "error.h"
@ -96,7 +97,10 @@ void Neighbor::full_nsq_omp(NeighList *list)
if (rsq <= cutneighsq[itype][jtype]) {
if (molecular) {
which = find_special(special[i],nspecial[i],tag[j]);
if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
if (which == 0) neighptr[n++] = j;
else if (domain->minimum_image_check(delx,dely,delz))
neighptr[n++] = j;
else if (which > 0) neighptr[n++] = j ^ (which << SBBITS);
} else neighptr[n++] = j;
}
}
@ -115,7 +119,7 @@ void Neighbor::full_nsq_omp(NeighList *list)
/* ----------------------------------------------------------------------
N^2 search for all neighbors
include neighbors of ghost atoms (no "special neighbors" for ghosts)
include neighbors of ghost atoms, but no "special neighbors" for ghosts
every neighbor pair appears in list of both atoms i and j
------------------------------------------------------------------------- */
@ -185,11 +189,13 @@ void Neighbor::full_nsq_ghost_omp(NeighList *list)
dely = ytmp - x[j][1];
delz = ztmp - x[j][2];
rsq = delx*delx + dely*dely + delz*delz;
if (rsq <= cutneighsq[itype][jtype]) {
if (molecular) {
which = find_special(special[i],nspecial[i],tag[j]);
if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
if (which == 0) neighptr[n++] = j;
else if (domain->minimum_image_check(delx,dely,delz))
neighptr[n++] = j;
else if (which > 0) neighptr[n++] = j ^ (which << SBBITS);
} else neighptr[n++] = j;
}
}
@ -304,7 +310,10 @@ void Neighbor::full_bin_omp(NeighList *list)
if (rsq <= cutneighsq[itype][jtype]) {
if (molecular) {
which = find_special(special[i],nspecial[i],tag[j]);
if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
if (which == 0) neighptr[n++] = j;
else if (domain->minimum_image_check(delx,dely,delz))
neighptr[n++] = j;
else if (which > 0) neighptr[n++] = j ^ (which << SBBITS);
} else neighptr[n++] = j;
}
}
@ -410,7 +419,10 @@ void Neighbor::full_bin_ghost_omp(NeighList *list)
if (rsq <= cutneighsq[itype][jtype]) {
if (molecular) {
which = find_special(special[i],nspecial[i],tag[j]);
if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
if (which == 0) neighptr[n++] = j;
else if (domain->minimum_image_check(delx,dely,delz))
neighptr[n++] = j;
else if (which > 0) neighptr[n++] = j ^ (which << SBBITS);
} else neighptr[n++] = j;
}
}
@ -545,7 +557,10 @@ void Neighbor::full_multi_omp(NeighList *list)
if (rsq <= cutneighsq[itype][jtype]) {
if (molecular) {
which = find_special(special[i],nspecial[i],tag[j]);
if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
if (which == 0) neighptr[n++] = j;
else if (domain->minimum_image_check(delx,dely,delz))
neighptr[n++] = j;
else if (which > 0) neighptr[n++] = j ^ (which << SBBITS);
} else neighptr[n++] = j;
}
}

View File

@ -16,6 +16,7 @@
#include "neigh_list.h"
#include "atom.h"
#include "comm.h"
#include "domain.h"
#include "error.h"
using namespace LAMMPS_NS;
@ -108,7 +109,10 @@ void Neighbor::half_bin_no_newton_omp(NeighList *list)
if (rsq <= cutneighsq[itype][jtype]) {
if (molecular) {
which = find_special(special[i],nspecial[i],tag[j]);
if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
if (which == 0) neighptr[n++] = j;
else if (domain->minimum_image_check(delx,dely,delz))
neighptr[n++] = j;
else if (which > 0) neighptr[n++] = j ^ (which << SBBITS);
} else neighptr[n++] = j;
}
}
@ -214,7 +218,11 @@ void Neighbor::half_bin_newton_omp(NeighList *list)
if (rsq <= cutneighsq[itype][jtype]) {
if (molecular) {
which = find_special(special[i],nspecial[i],tag[j]);
if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
if (which == 0) neighptr[n++] = j;
else if (domain->minimum_image_check(delx,dely,delz))
neighptr[n++] = j;
else if (which > 0) neighptr[n++] = j ^ (which << SBBITS);
// OLD: if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
} else neighptr[n++] = j;
}
}
@ -235,7 +243,11 @@ void Neighbor::half_bin_newton_omp(NeighList *list)
if (rsq <= cutneighsq[itype][jtype]) {
if (molecular) {
which = find_special(special[i],nspecial[i],tag[j]);
if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
if (which == 0) neighptr[n++] = j;
else if (domain->minimum_image_check(delx,dely,delz))
neighptr[n++] = j;
else if (which > 0) neighptr[n++] = j ^ (which << SBBITS);
// OLD: if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
} else neighptr[n++] = j;
}
}
@ -346,7 +358,10 @@ void Neighbor::half_bin_newton_tri_omp(NeighList *list)
if (rsq <= cutneighsq[itype][jtype]) {
if (molecular) {
which = find_special(special[i],nspecial[i],tag[j]);
if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
if (which == 0) neighptr[n++] = j;
else if (domain->minimum_image_check(delx,dely,delz))
neighptr[n++] = j;
else if (which > 0) neighptr[n++] = j ^ (which << SBBITS);
} else neighptr[n++] = j;
}
}

View File

@ -16,6 +16,7 @@
#include "neigh_list.h"
#include "atom.h"
#include "comm.h"
#include "domain.h"
#include "error.h"
using namespace LAMMPS_NS;
@ -116,7 +117,10 @@ void Neighbor::half_multi_no_newton_omp(NeighList *list)
if (rsq <= cutneighsq[itype][jtype]) {
if (molecular) {
which = find_special(special[i],nspecial[i],tag[j]);
if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
if (which == 0) neighptr[n++] = j;
else if (domain->minimum_image_check(delx,dely,delz))
neighptr[n++] = j;
else if (which > 0) neighptr[n++] = j ^ (which << SBBITS);
} else neighptr[n++] = j;
}
}
@ -225,7 +229,10 @@ void Neighbor::half_multi_newton_omp(NeighList *list)
if (rsq <= cutneighsq[itype][jtype]) {
if (molecular) {
which = find_special(special[i],nspecial[i],tag[j]);
if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
if (which == 0) neighptr[n++] = j;
else if (domain->minimum_image_check(delx,dely,delz))
neighptr[n++] = j;
else if (which > 0) neighptr[n++] = j ^ (which << SBBITS);
} else neighptr[n++] = j;
}
}
@ -253,7 +260,10 @@ void Neighbor::half_multi_newton_omp(NeighList *list)
if (rsq <= cutneighsq[itype][jtype]) {
if (molecular) {
which = find_special(special[i],nspecial[i],tag[j]);
if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
if (which == 0) neighptr[n++] = j;
else if (domain->minimum_image_check(delx,dely,delz))
neighptr[n++] = j;
else if (which > 0) neighptr[n++] = j ^ (which << SBBITS);
} else neighptr[n++] = j;
}
}
@ -374,7 +384,10 @@ void Neighbor::half_multi_newton_tri_omp(NeighList *list)
if (rsq <= cutneighsq[itype][jtype]) {
if (molecular) {
which = find_special(special[i],nspecial[i],tag[j]);
if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
if (which == 0) neighptr[n++] = j;
else if (domain->minimum_image_check(delx,dely,delz))
neighptr[n++] = j;
else if (which > 0) neighptr[n++] = j ^ (which << SBBITS);
} else neighptr[n++] = j;
}
}

View File

@ -16,6 +16,7 @@
#include "neigh_list.h"
#include "atom.h"
#include "comm.h"
#include "domain.h"
#include "group.h"
#include "error.h"
@ -96,7 +97,10 @@ void Neighbor::half_nsq_no_newton_omp(NeighList *list)
if (rsq <= cutneighsq[itype][jtype]) {
if (molecular) {
which = find_special(special[i],nspecial[i],tag[j]);
if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
if (which == 0) neighptr[n++] = j;
else if (domain->minimum_image_check(delx,dely,delz))
neighptr[n++] = j;
else if (which > 0) neighptr[n++] = j ^ (which << SBBITS);
} else neighptr[n++] = j;
}
}
@ -205,7 +209,10 @@ void Neighbor::half_nsq_newton_omp(NeighList *list)
if (rsq <= cutneighsq[itype][jtype]) {
if (molecular) {
which = find_special(special[i],nspecial[i],tag[j]);
if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
if (which == 0) neighptr[n++] = j;
else if (domain->minimum_image_check(delx,dely,delz))
neighptr[n++] = j;
else if (which > 0) neighptr[n++] = j ^ (which << SBBITS);
} else neighptr[n++] = j;
}
}

View File

@ -16,6 +16,7 @@
#include "neigh_list.h"
#include "atom.h"
#include "comm.h"
#include "domain.h"
#include "group.h"
#include "error.h"
@ -92,6 +93,7 @@ void Neighbor::respa_nsq_no_newton_omp(NeighList *list)
int npnt_middle = 0;
int which = 0;
int minchange = 0;
for (i = ifrom; i < ito; i++) {
@ -150,16 +152,21 @@ void Neighbor::respa_nsq_no_newton_omp(NeighList *list)
if (rsq <= cutneighsq[itype][jtype]) {
if (molecular) {
which = find_special(special[i],nspecial[i],tag[j]);
if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
if (which == 0) neighptr[n++] = j;
else if (minchange = domain->minimum_image_check(delx,dely,delz))
neighptr[n++] = j;
else if (which > 0) neighptr[n++] = j ^ (which << SBBITS);
} else neighptr[n++] = j;
if (rsq < cut_inner_sq) {
if (which == 0) neighptr_inner[n_inner++] = j;
else if (minchange) neighptr_inner[n_inner++] = j;
else if (which > 0) neighptr_inner[n_inner++] = j ^ (which << SBBITS);
}
if (respamiddle && rsq < cut_middle_sq && rsq > cut_middle_inside_sq) {
if (which == 0) neighptr_middle[n_middle++] = j;
else if (minchange) neighptr_middle[n_middle++] = j;
else if (which > 0)
neighptr_middle[n_middle++] = j ^ (which << SBBITS);
}
@ -267,6 +274,7 @@ void Neighbor::respa_nsq_newton_omp(NeighList *list)
int npnt_middle = 0;
int which = 0;
int minchange = 0;
for (i = ifrom; i < ito; i++) {
@ -342,17 +350,22 @@ void Neighbor::respa_nsq_newton_omp(NeighList *list)
if (rsq <= cutneighsq[itype][jtype]) {
if (molecular) {
which = find_special(special[i],nspecial[i],tag[j]);
if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
if (which == 0) neighptr[n++] = j;
else if (minchange = domain->minimum_image_check(delx,dely,delz))
neighptr[n++] = j;
else if (which > 0) neighptr[n++] = j ^ (which << SBBITS);
} else neighptr[n++] = j;
if (rsq < cut_inner_sq) {
if (which == 0) neighptr_inner[n_inner++] = j;
else if (minchange) neighptr_inner[n_inner++] = j;
else if (which > 0) neighptr_inner[n_inner++] = j ^ (which << SBBITS);
}
if (respamiddle &&
rsq < cut_middle_sq && rsq > cut_middle_inside_sq) {
if (which == 0) neighptr_middle[n_middle++] = j;
else if (minchange) neighptr_middle[n_middle++] = j;
else if (which > 0)
neighptr_middle[n_middle++] = j ^ (which << SBBITS);
}
@ -464,6 +477,7 @@ void Neighbor::respa_bin_no_newton_omp(NeighList *list)
int npnt_middle = 0;
int which = 0;
int minchange = 0;
for (i = ifrom; i < ito; i++) {
@ -528,11 +542,15 @@ void Neighbor::respa_bin_no_newton_omp(NeighList *list)
if (rsq <= cutneighsq[itype][jtype]) {
if (molecular) {
which = find_special(special[i],nspecial[i],tag[j]);
if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
if (which == 0) neighptr[n++] = j;
else if (minchange = domain->minimum_image_check(delx,dely,delz))
neighptr[n++] = j;
else if (which > 0) neighptr[n++] = j ^ (which << SBBITS);
} else neighptr[n++] = j;
if (rsq < cut_inner_sq) {
if (which == 0) neighptr_inner[n_inner++] = j;
else if (minchange) neighptr_inner[n_inner++] = j;
else if (which > 0)
neighptr_inner[n_inner++] = j ^ (which << SBBITS);
}
@ -540,6 +558,7 @@ void Neighbor::respa_bin_no_newton_omp(NeighList *list)
if (respamiddle &&
rsq < cut_middle_sq && rsq > cut_middle_inside_sq) {
if (which == 0) neighptr_middle[n_middle++] = j;
else if (minchange) neighptr_middle[n_middle++] = j;
else if (which > 0)
neighptr_middle[n_middle++] = j ^ (which << SBBITS);
}
@ -651,6 +670,7 @@ void Neighbor::respa_bin_newton_omp(NeighList *list)
int npnt_middle = 0;
int which = 0;
int minchange = 0;
for (i = ifrom; i < ito; i++) {
@ -718,17 +738,22 @@ void Neighbor::respa_bin_newton_omp(NeighList *list)
if (rsq <= cutneighsq[itype][jtype]) {
if (molecular) {
which = find_special(special[i],nspecial[i],tag[j]);
if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
if (which == 0) neighptr[n++] = j;
else if (minchange = domain->minimum_image_check(delx,dely,delz))
neighptr[n++] = j;
else if (which > 0) neighptr[n++] = j ^ (which << SBBITS);
} else neighptr[n++] = j;
if (rsq < cut_inner_sq) {
if (which == 0) neighptr_inner[n_inner++] = j;
else if (minchange) neighptr_inner[n_inner++] = j;
else if (which > 0) neighptr_inner[n_inner++] = j ^ (which << SBBITS);
}
if (respamiddle &&
rsq < cut_middle_sq && rsq > cut_middle_inside_sq) {
if (which == 0) neighptr_middle[n_middle++] = j;
else if (minchange) neighptr_middle[n_middle++] = j;
else if (which > 0)
neighptr_middle[n_middle++] = j ^ (which << SBBITS);
}
@ -751,11 +776,15 @@ void Neighbor::respa_bin_newton_omp(NeighList *list)
if (rsq <= cutneighsq[itype][jtype]) {
if (molecular) {
which = find_special(special[i],nspecial[i],tag[j]);
if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
if (which == 0) neighptr[n++] = j;
else if (minchange = domain->minimum_image_check(delx,dely,delz))
neighptr[n++] = j;
else if (which > 0) neighptr[n++] = j ^ (which << SBBITS);
} else neighptr[n++] = j;
if (rsq < cut_inner_sq) {
if (which == 0) neighptr_inner[n_inner++] = j;
else if (minchange) neighptr_inner[n_inner++] = j;
else if (which > 0)
neighptr_inner[n_inner++] = j ^ (which << SBBITS);
}
@ -763,6 +792,7 @@ void Neighbor::respa_bin_newton_omp(NeighList *list)
if (respamiddle &&
rsq < cut_middle_sq && rsq > cut_middle_inside_sq) {
if (which == 0) neighptr_middle[n_middle++] = j;
else if (minchange) neighptr_middle[n_middle++] = j;
else if (which > 0)
neighptr_middle[n_middle++] = j ^ (which << SBBITS);
}
@ -874,6 +904,7 @@ void Neighbor::respa_bin_newton_tri_omp(NeighList *list)
int npnt_middle = 0;
int which = 0;
int minchange = 0;
for (i = ifrom; i < ito; i++) {
@ -946,11 +977,15 @@ void Neighbor::respa_bin_newton_tri_omp(NeighList *list)
if (rsq <= cutneighsq[itype][jtype]) {
if (molecular) {
which = find_special(special[i],nspecial[i],tag[j]);
if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
if (which == 0) neighptr[n++] = j;
else if (minchange = domain->minimum_image_check(delx,dely,delz))
neighptr[n++] = j;
else if (which > 0) neighptr[n++] = j ^ (which << SBBITS);
} else neighptr[n++] = j;
if (rsq < cut_inner_sq) {
if (which == 0) neighptr_inner[n_inner++] = j;
else if (minchange) neighptr_inner[n_inner++] = j;
else if (which > 0)
neighptr_inner[n_inner++] = j ^ (which << SBBITS);
}
@ -958,6 +993,7 @@ void Neighbor::respa_bin_newton_tri_omp(NeighList *list)
if (respamiddle &&
rsq < cut_middle_sq && rsq > cut_middle_inside_sq) {
if (which == 0) neighptr_middle[n_middle++] = j;
else if (minchange) neighptr_middle[n_middle++] = j;
else if (which > 0)
neighptr_middle[n_middle++] = j ^ (which << SBBITS);
}