Commit c52a2638 authored by sjplimp's avatar sjplimp Committed by GitHub
Browse files

Merge pull request #339 from akohlmey/fixes-for-srp-example

Fixes for srp example
parents ad4d2999 0a2b78ac
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -15,6 +15,7 @@ bond_style harmonic
bond_coeff      * 225.0 0.85

comm_modify vel yes
comm_modify cutoff 3.6

# must use pair hybrid, since srp bond particles
# do not interact with other atoms types
+6 −9
Original line number Diff line number Diff line
@@ -67,7 +67,7 @@ FixSRP::FixSRP(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)

  // zero
  for (int i = 0; i < atom->nmax; i++)
    for (int m = 0; m < 3; m++)
    for (int m = 0; m < 2; m++)
      array[i][m] = 0.0;
}

@@ -170,7 +170,7 @@ void FixSRP::setup_pre_force(int zz)
    xold[i][2] = x[i][2];
    tagold[i]=tag[i];
    dlist[i] = (type[i] == bptype) ? 1 : 0;
    for (n = 0; n < 3; n++)
    for (n = 0; n < 2; n++)
      array[i][n] = 0.0;
  }

@@ -264,14 +264,11 @@ void FixSRP::setup_pre_force(int zz)
  if (cutghostmin > comm->cutghost[2])
    cutghostmin = comm->cutghost[2];

  // reset cutghost if needed
  // stop if cutghost is insufficient
  if (cutneighmax_srp > cutghostmin){
    if(comm->me == 0){
      sprintf(str, "Extending ghost comm cutoff. New %f, old %f.", cutneighmax_srp, cutghostmin);
      error->message(FLERR,str);
    }
    // cutghost updated by comm->setup
    comm->cutghostuser = cutneighmax_srp;
    sprintf(str, "Communication cutoff too small for fix srp. "
            "Need %f, current %f.", cutneighmax_srp, cutghostmin);
    error->all(FLERR,str);
  }

  // assign tags for new atoms, update map
+2 −0
Original line number Diff line number Diff line
@@ -714,6 +714,8 @@ void Neighbor::init_pair()
      if (requests[i]->kokkos_host != requests[j]->kokkos_host) continue;

      if (requests[i]->ssa != requests[j]->ssa) continue;
      // newton 2 and newton 0 both are newton off
      if ((requests[i]->newton & 2) != (requests[j]->newton & 2)) continue;

      if (requests[i]->half && requests[j]->pair && 
          !requests[j]->skip && requests[j]->half && !requests[j]->copy)
+4 −3
Original line number Diff line number Diff line
@@ -24,7 +24,8 @@ using namespace LAMMPS_NS;

/* ---------------------------------------------------------------------- */

NPair::NPair(LAMMPS *lmp) : Pointers(lmp)
NPair::NPair(LAMMPS *lmp)
  : Pointers(lmp), nb(NULL), ns(NULL), bins(NULL), stencil(NULL)
{
  last_build = -1;
  last_copy_bin_setup = last_copy_bin = last_copy_stencil = -1;
@@ -130,11 +131,11 @@ void NPair::build_setup()
    copy_bin_setup_info();
    last_copy_bin_setup = update->ntimestep;
  }
  if (nb && last_copy_bin < nb->last_bin_memory) {
  if (nb && ((last_copy_bin < nb->last_bin_memory) || (bins != nb->bins))) {
    copy_bin_info();
    last_copy_bin = update->ntimestep;
  }
  if (ns && last_copy_stencil < ns->last_create) {
  if (ns && ((last_copy_stencil < ns->last_create) || (stencil != ns->stencil))) {
    copy_stencil_info();
    last_copy_stencil = update->ntimestep;
  }