Commit fb279a87 authored by Tim Mattox's avatar Tim Mattox
Browse files

USER-DPD: properly compute AIRct_ssa values, and use them in fix_shardlow.

Eliminates last use of per-atom ssaAIR values within initial_integrate()
parent e9d46f4e
Loading
Loading
Loading
Loading
+23 −13
Original line number Diff line number Diff line
@@ -538,10 +538,22 @@ void FixShardlow::initial_integrate(int vflag)
  dtsqrt = sqrt(update->dt);

  ii = 0;
  //Loop over all 14 directions (8 stages)
  for (airnum = 1; airnum <=8; airnum++){
  // process neighbors in the local AIR
  while (ii < inum) {
    i = ilist[ii];
    int len = list->numneigh[i];
    if (len > 0) {
      if (useDPDE) ssa_update_dpde(i, &(list->firstneigh[i][0]), len);
      else ssa_update_dpd(i, &(list->firstneigh[i][0]), len);
    }
    ii++;
  }

  ii = inum;
  //Loop over all 13 outward directions (7 stages)
  for (airnum = 1; airnum <=7; airnum++){
    int ct = list->AIRct_ssa[airnum];

    if (airnum > 1) {
    // Communicate the updated velocities to all nodes
    comm->forward_comm_fix(this);

@@ -550,12 +562,10 @@ void FixShardlow::initial_integrate(int vflag)
      memset(&(atom->uCond[nlocal]), 0, sizeof(double)*nghost);
      memset(&(atom->uMech[nlocal]), 0, sizeof(double)*nghost);
    }
    }

    // process neighbors in this AIR
    while (ii < anum) {
    while (ct-- > 0) {
      i = ilist[ii];
      if (atom->ssaAIR[i] > airnum) break; /* done with curent AIR */
      int len = list->numneigh[i];
      if (len > 0) {
        if (useDPDE) ssa_update_dpde(i, &(list->firstneigh[i][0]), len);
@@ -565,7 +575,7 @@ void FixShardlow::initial_integrate(int vflag)
    }

    // Communicate the ghost deltas to the atom owners
    if (airnum > 1) comm->reverse_comm_fix(this);
    comm->reverse_comm_fix(this);

  }  //End Loop over all directions For airnum = Top, Top-Right, Right, Bottom-Right, Back

+6 −2
Original line number Diff line number Diff line
@@ -199,7 +199,7 @@ void NPairHalfBinNewtonSSA::build(NeighList *list)
  // loop over AIR ghost atoms, storing their local neighbors
  // since these are ghosts, must check if stencil bin is out of bounds
  for (int airnum = 2; airnum <= 8; airnum++) {
    list->AIRct_ssa[airnum - 1] = nb_ssa->gairct_ssa[airnum];
    int locAIRct = 0;
    for (i = gairhead_ssa[airnum]; i >= 0; i = bins[i]) {
      n = 0;
      neighptr = ipage->vget();
@@ -254,13 +254,17 @@ void NPairHalfBinNewtonSSA::build(NeighList *list)
        }
      }

      if (n > 0) ilist[inum + (gnum++)] = i;
      if (n > 0) {
        ilist[inum + (gnum++)] = i;
        ++locAIRct;
      }
      firstneigh[i] = neighptr;
      numneigh[i] = n;
      ipage->vgot(n);
      if (ipage->status())
        error->one(FLERR,"Neighbor (ghost) list overflow, boost neigh_modify one");
    }
    list->AIRct_ssa[airnum - 1] = locAIRct;
  }
  list->gnum = gnum;
}