forked from lijiext/lammps
Add ghost option to npair_halffull
This commit is contained in:
parent
1bd9e175e9
commit
1c10c78684
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue