Commit b1567717 authored by Axel Kohlmeyer's avatar Axel Kohlmeyer
Browse files

build short neighbor list for sw on based on ij parameters only

parent c4b86a25
Loading
Loading
Loading
Loading
+5 −7
Original line number Diff line number Diff line
@@ -100,7 +100,6 @@ void PairSW::compute(int eflag, int vflag)
  int *type = atom->type;
  int nlocal = atom->nlocal;
  int newton_pair = force->newton_pair;
  const double cutshortsq = cutmax*cutmax;

  inum = list->inum;
  ilist = list->ilist;
@@ -132,7 +131,11 @@ void PairSW::compute(int eflag, int vflag)
      delz = ztmp - x[j][2];
      rsq = delx*delx + dely*dely + delz*delz;

      if (rsq < cutshortsq) {
      jtype = map[type[j]];
      ijparam = elem2param[itype][jtype][jtype];
      if (rsq >= params[ijparam].cutsq) {
        continue;
      } else {
        neighshort[numshort++] = j;
        if (numshort >= maxshort) {
          maxshort += maxshort/2;
@@ -151,9 +154,6 @@ void PairSW::compute(int eflag, int vflag)
        if (x[j][2] == ztmp && x[j][1] == ytmp && x[j][0] < xtmp) continue;
      }

      jtype = map[type[j]];
      ijparam = elem2param[itype][jtype][jtype];
      if (rsq >= params[ijparam].cutsq) continue;

      twobody(&params[ijparam],rsq,fpair,eflag,evdwl);

@@ -178,7 +178,6 @@ void PairSW::compute(int eflag, int vflag)
      delr1[1] = x[j][1] - ytmp;
      delr1[2] = x[j][2] - ztmp;
      rsq1 = delr1[0]*delr1[0] + delr1[1]*delr1[1] + delr1[2]*delr1[2];
      if (rsq1 >= params[ijparam].cutsq) continue;

      for (kk = jj+1; kk < numshort; kk++) {
        k = neighshort[kk];
@@ -190,7 +189,6 @@ void PairSW::compute(int eflag, int vflag)
        delr2[1] = x[k][1] - ytmp;
        delr2[2] = x[k][2] - ztmp;
        rsq2 = delr2[0]*delr2[0] + delr2[1]*delr2[1] + delr2[2]*delr2[2];
        if (rsq2 >= params[ikparam].cutsq) continue;

        threebody(&params[ijparam],&params[ikparam],&params[ijkparam],
                  rsq1,rsq2,delr1,delr2,fj,fk,eflag,evdwl);
+6 −9
Original line number Diff line number Diff line
@@ -87,7 +87,6 @@ void PairSWOMP::eval(int iifrom, int iito, ThrData * const thr)
  const tagint * _noalias const tag = atom->tag;
  const int * _noalias const type = atom->type;
  const int nlocal = atom->nlocal;
  const double cutshortsq = cutmax*cutmax;

  ilist = list->ilist;
  numneigh = list->numneigh;
@@ -124,11 +123,15 @@ void PairSWOMP::eval(int iifrom, int iito, ThrData * const thr)
      delz = ztmp - x[j].z;
      rsq = delx*delx + dely*dely + delz*delz;

      if (rsq < cutshortsq) {
      jtype = map[type[j]];
      ijparam = elem2param[itype][jtype][jtype];
      if (rsq >= params[ijparam].cutsq) {
        continue;
      } else {
        neighshort_thr[numshort++] = j;
        if (numshort >= maxshort_thr) {
          maxshort_thr += maxshort_thr/2;
          memory->grow(neighshort_thr,maxshort_thr,"pair_thr:neighshort_thr");
          memory->grow(neighshort_thr,maxshort_thr,"pair:neighshort_thr");
        }
      }

@@ -143,10 +146,6 @@ void PairSWOMP::eval(int iifrom, int iito, ThrData * const thr)
        if (x[j].z == ztmp && x[j].y == ytmp && x[j].x < xtmp) continue;
      }

      jtype = map[type[j]];
      ijparam = elem2param[itype][jtype][jtype];
      if (rsq >= params[ijparam].cutsq) continue;

      twobody(&params[ijparam],rsq,fpair,EFLAG,evdwl);

      fxtmp += delx*fpair;
@@ -170,7 +169,6 @@ void PairSWOMP::eval(int iifrom, int iito, ThrData * const thr)
      delr1[1] = x[j].y - ytmp;
      delr1[2] = x[j].z - ztmp;
      rsq1 = delr1[0]*delr1[0] + delr1[1]*delr1[1] + delr1[2]*delr1[2];
      if (rsq1 >= params[ijparam].cutsq) continue;

      double fjxtmp,fjytmp,fjztmp;
      fjxtmp = fjytmp = fjztmp = 0.0;
@@ -185,7 +183,6 @@ void PairSWOMP::eval(int iifrom, int iito, ThrData * const thr)
        delr2[1] = x[k].y - ytmp;
        delr2[2] = x[k].z - ztmp;
        rsq2 = delr2[0]*delr2[0] + delr2[1]*delr2[1] + delr2[2]*delr2[2];
        if (rsq2 >= params[ikparam].cutsq) continue;

        threebody(&params[ijparam],&params[ikparam],&params[ijkparam],
                  rsq1,rsq2,delr1,delr2,fj,fk,EFLAG,evdwl);