Skip to content
Snippets Groups Projects
Commit 1c10c786 authored by Stan Moore's avatar Stan Moore
Browse files

Add ghost option to npair_halffull

parent 1bd9e175
No related branches found
No related tags found
No related merge requests found
...@@ -32,6 +32,8 @@ NPairHalffullNewtoff::NPairHalffullNewtoff(LAMMPS *lmp) : NPair(lmp) {} ...@@ -32,6 +32,8 @@ NPairHalffullNewtoff::NPairHalffullNewtoff(LAMMPS *lmp) : NPair(lmp) {}
pair stored once if i,j are both owned and i < j 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) pair stored by me if j is ghost (also stored by proc owning j)
works if full list is a skip list 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) void NPairHalffullNewtoff::build(NeighList *list)
...@@ -39,6 +41,8 @@ void NPairHalffullNewtoff::build(NeighList *list) ...@@ -39,6 +41,8 @@ void NPairHalffullNewtoff::build(NeighList *list)
int i,j,ii,jj,n,jnum,joriginal; int i,j,ii,jj,n,jnum,joriginal;
int *neighptr,*jlist; int *neighptr,*jlist;
int nlocal = atom->nlocal;
int *ilist = list->ilist; int *ilist = list->ilist;
int *numneigh = list->numneigh; int *numneigh = list->numneigh;
int **firstneigh = list->firstneigh; int **firstneigh = list->firstneigh;
...@@ -48,6 +52,7 @@ void NPairHalffullNewtoff::build(NeighList *list) ...@@ -48,6 +52,7 @@ void NPairHalffullNewtoff::build(NeighList *list)
int *numneigh_full = list->listfull->numneigh; int *numneigh_full = list->listfull->numneigh;
int **firstneigh_full = list->listfull->firstneigh; int **firstneigh_full = list->listfull->firstneigh;
int inum_full = list->listfull->inum; int inum_full = list->listfull->inum;
if (list->ghost) inum_full += list->listfull->gnum;
int inum = 0; int inum = 0;
ipage->reset(); ipage->reset();
...@@ -79,4 +84,12 @@ void NPairHalffullNewtoff::build(NeighList *list) ...@@ -79,4 +84,12 @@ void NPairHalffullNewtoff::build(NeighList *list)
} }
list->inum = inum; 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, ...@@ -23,6 +23,16 @@ NPairStyle(halffull/newtoff/skip,
NP_HALF_FULL | NP_NEWTOFF | NP_NSQ | NP_BIN | NP_MULTI | NP_HALF | NP_HALF_FULL | NP_NEWTOFF | NP_NSQ | NP_BIN | NP_MULTI | NP_HALF |
NP_ORTHO | NP_TRI | NP_SKIP) 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 #else
#ifndef LMP_NPAIR_HALFFULL_NEWTOFF_H #ifndef LMP_NPAIR_HALFFULL_NEWTOFF_H
......
...@@ -32,6 +32,8 @@ NPairHalffullNewton::NPairHalffullNewton(LAMMPS *lmp) : NPair(lmp) {} ...@@ -32,6 +32,8 @@ NPairHalffullNewton::NPairHalffullNewton(LAMMPS *lmp) : NPair(lmp) {}
pair stored once if i,j are both owned and i < j 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 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 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) void NPairHalffullNewton::build(NeighList *list)
...@@ -52,6 +54,7 @@ void NPairHalffullNewton::build(NeighList *list) ...@@ -52,6 +54,7 @@ void NPairHalffullNewton::build(NeighList *list)
int *numneigh_full = list->listfull->numneigh; int *numneigh_full = list->listfull->numneigh;
int **firstneigh_full = list->listfull->firstneigh; int **firstneigh_full = list->listfull->firstneigh;
int inum_full = list->listfull->inum; int inum_full = list->listfull->inum;
if (list->ghost) inum_full += list->listfull->gnum;
int inum = 0; int inum = 0;
ipage->reset(); ipage->reset();
...@@ -96,4 +99,12 @@ void NPairHalffullNewton::build(NeighList *list) ...@@ -96,4 +99,12 @@ void NPairHalffullNewton::build(NeighList *list)
} }
list->inum = inum; 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, ...@@ -23,6 +23,16 @@ NPairStyle(halffull/newton/skip,
NP_HALF_FULL | NP_NEWTON | NP_HALF | NP_NSQ | NP_BIN | NP_MULTI | NP_HALF_FULL | NP_NEWTON | NP_HALF | NP_NSQ | NP_BIN | NP_MULTI |
NP_ORTHO | NP_TRI | NP_SKIP) 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 #else
#ifndef LMP_NPAIR_HALFFULL_NEWTON_H #ifndef LMP_NPAIR_HALFFULL_NEWTON_H
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment