diff --git a/src/npair_halffull_newtoff.cpp b/src/npair_halffull_newtoff.cpp index bd7cc4dd59758924fa63e928b5a133ef7d879986..da5f6d226c4adaed921a10a0e6b8a9b2847c8325 100644 --- a/src/npair_halffull_newtoff.cpp +++ b/src/npair_halffull_newtoff.cpp @@ -32,6 +32,8 @@ NPairHalffullNewtoff::NPairHalffullNewtoff(LAMMPS *lmp) : NPair(lmp) {} pair stored once if i,j are both owned and i < j pair stored by me if j is ghost (also stored by proc owning j) works if full list is a skip list + works for owned (non-ghost) list, also for ghost list + if ghost, also store neighbors of ghost atoms & set inum,gnum correctly ------------------------------------------------------------------------- */ void NPairHalffullNewtoff::build(NeighList *list) @@ -39,6 +41,8 @@ void NPairHalffullNewtoff::build(NeighList *list) int i,j,ii,jj,n,jnum,joriginal; int *neighptr,*jlist; + int nlocal = atom->nlocal; + int *ilist = list->ilist; int *numneigh = list->numneigh; int **firstneigh = list->firstneigh; @@ -48,6 +52,7 @@ void NPairHalffullNewtoff::build(NeighList *list) int *numneigh_full = list->listfull->numneigh; int **firstneigh_full = list->listfull->firstneigh; int inum_full = list->listfull->inum; + if (list->ghost) inum_full += list->listfull->gnum; int inum = 0; ipage->reset(); @@ -79,4 +84,12 @@ void NPairHalffullNewtoff::build(NeighList *list) } list->inum = inum; + if (list->ghost) { + int num = 0; + for (i = 0; i < inum; i++) + if (ilist[i] < nlocal) num++; + else break; + list->inum = num; + list->gnum = inum - num; + } } diff --git a/src/npair_halffull_newtoff.h b/src/npair_halffull_newtoff.h index 24d439a331c6832c7c3cc8346c545feff766d255..c4f7d00a01b37a51db922374588be604cd8a4d66 100644 --- a/src/npair_halffull_newtoff.h +++ b/src/npair_halffull_newtoff.h @@ -23,6 +23,16 @@ NPairStyle(halffull/newtoff/skip, NP_HALF_FULL | NP_NEWTOFF | NP_NSQ | NP_BIN | NP_MULTI | NP_HALF | NP_ORTHO | NP_TRI | NP_SKIP) +NPairStyle(halffull/newtoff/ghost, + NPairHalffullNewtoff, + NP_HALF_FULL | NP_NEWTOFF | NP_NSQ | NP_BIN | NP_MULTI | NP_HALF | + NP_ORTHO | NP_TRI | NP_GHOST) + +NPairStyle(halffull/newtoff/skip/ghost, + NPairHalffullNewtoff, + NP_HALF_FULL | NP_NEWTOFF | NP_NSQ | NP_BIN | NP_MULTI | NP_HALF | + NP_ORTHO | NP_TRI | NP_SKIP | NP_GHOST) + #else #ifndef LMP_NPAIR_HALFFULL_NEWTOFF_H diff --git a/src/npair_halffull_newton.cpp b/src/npair_halffull_newton.cpp index 371bbd33a85cd6c73c3b20a03e3251a4c1c3f7e9..d6de8a376650bd96e2aab5c9beb4b25d55a52bef 100644 --- a/src/npair_halffull_newton.cpp +++ b/src/npair_halffull_newton.cpp @@ -32,6 +32,8 @@ NPairHalffullNewton::NPairHalffullNewton(LAMMPS *lmp) : NPair(lmp) {} pair stored once if i,j are both owned and i < j if j is ghost, only store if j coords are "above and to the right" of i works if full list is a skip list + works for owned (non-ghost) list, also for ghost list + if ghost, also store neighbors of ghost atoms & set inum,gnum correctly ------------------------------------------------------------------------- */ void NPairHalffullNewton::build(NeighList *list) @@ -52,6 +54,7 @@ void NPairHalffullNewton::build(NeighList *list) int *numneigh_full = list->listfull->numneigh; int **firstneigh_full = list->listfull->firstneigh; int inum_full = list->listfull->inum; + if (list->ghost) inum_full += list->listfull->gnum; int inum = 0; ipage->reset(); @@ -96,4 +99,12 @@ void NPairHalffullNewton::build(NeighList *list) } list->inum = inum; + if (list->ghost) { + int num = 0; + for (i = 0; i < inum; i++) + if (ilist[i] < nlocal) num++; + else break; + list->inum = num; + list->gnum = inum - num; + } } diff --git a/src/npair_halffull_newton.h b/src/npair_halffull_newton.h index 3d20d686c327631e43b3374c86e7e6e73c7e637f..2d1ff3f60443301318886908617ce9a8ca19ff7d 100644 --- a/src/npair_halffull_newton.h +++ b/src/npair_halffull_newton.h @@ -23,6 +23,16 @@ NPairStyle(halffull/newton/skip, NP_HALF_FULL | NP_NEWTON | NP_HALF | NP_NSQ | NP_BIN | NP_MULTI | NP_ORTHO | NP_TRI | NP_SKIP) +NPairStyle(halffull/newton/ghost, + NPairHalffullNewton, + NP_HALF_FULL | NP_NEWTON | NP_HALF | NP_NSQ | NP_BIN | NP_MULTI | + NP_ORTHO | NP_TRI | NP_GHOST) + +NPairStyle(halffull/newton/skip/ghost, + NPairHalffullNewton, + NP_HALF_FULL | NP_NEWTON | NP_HALF | NP_NSQ | NP_BIN | NP_MULTI | + NP_ORTHO | NP_TRI | NP_SKIP | NP_GHOST) + #else #ifndef LMP_NPAIR_HALFFULL_NEWTON_H