Updating from master to 19May17
This commit is contained in:
@ -640,6 +640,24 @@ int Neighbor::init_pair()
|
||||
delete [] neigh_stencil;
|
||||
delete [] neigh_pair;
|
||||
|
||||
// error check on requests
|
||||
// do not allow occasional, ghost, bin list
|
||||
// b/c it still uses variant of coord2bin() in NPair() method
|
||||
// instead of atom2bin, this could cause error b/c stoms have
|
||||
// moved out of proc domain by time occasional list is built
|
||||
// solution would be to use a different NBin variant
|
||||
// that used Npair::coord2bin(x,ix,iy,iz) (then delete it from NPair)
|
||||
// and stored the ix,iy,iz values for all atoms (including ghosts)
|
||||
// at time of binning when neighbor lists are rebuilt,
|
||||
// similar to what vanilla Nbin::coord2atom() does now in atom2bin
|
||||
|
||||
if (style == BIN) {
|
||||
for (i = 0; i < nrequest; i++)
|
||||
if (requests[i]->occasional && requests[i]->ghost)
|
||||
error->all(FLERR,"Cannot request an occasional binned neighbor list "
|
||||
"with ghost info");
|
||||
}
|
||||
|
||||
// morph requests in various ways
|
||||
// purpose is to avoid duplicate or inefficient builds
|
||||
// may add new requests if a needed request to derive from does not exist
|
||||
@ -667,7 +685,7 @@ int Neighbor::init_pair()
|
||||
|
||||
// create new lists, one per request including added requests
|
||||
// wait to allocate initial pages until copy lists are detected
|
||||
// NOTE: can I allocation now, instead of down below?
|
||||
// NOTE: can I allocate now, instead of down below?
|
||||
|
||||
nlist = nrequest;
|
||||
|
||||
@ -1216,7 +1234,7 @@ void Neighbor::morph_copy()
|
||||
|
||||
// check all other lists
|
||||
|
||||
for (j = 0; j < i; j++) {
|
||||
for (j = 0; j < nrequest; j++) {
|
||||
if (i == j) continue;
|
||||
jrq = requests[j];
|
||||
|
||||
@ -1224,10 +1242,13 @@ void Neighbor::morph_copy()
|
||||
|
||||
if (jrq->copy && jrq->copylist == i) continue;
|
||||
|
||||
// parent list must be perpetual
|
||||
// copied list can be perpetual or occasional
|
||||
// other list (jrq) to copy from must be perpetual
|
||||
// list that becomes a copy list (irq) can be perpetual or occasional
|
||||
// if both lists are perpetual, require j < i
|
||||
// to prevent circular dependence with 3 or more copies of a list
|
||||
|
||||
if (jrq->occasional) continue;
|
||||
if (!irq->occasional && j > i) continue;
|
||||
|
||||
// both lists must be half, or both full
|
||||
|
||||
@ -1279,7 +1300,7 @@ void Neighbor::morph_copy()
|
||||
// turn list I into a copy of list J
|
||||
// do not copy a list from another copy list, but from its parent list
|
||||
|
||||
if (j < i) {
|
||||
if (j < nrequest) {
|
||||
irq->copy = 1;
|
||||
if (jrq->copy) irq->copylist = jrq->copylist;
|
||||
else irq->copylist = j;
|
||||
@ -1666,7 +1687,6 @@ int Neighbor::choose_stencil(NeighRequest *rq)
|
||||
else if (rq->newton == 1) newtflag = 1;
|
||||
else if (rq->newton == 2) newtflag = 0;
|
||||
|
||||
|
||||
//printf("STENCIL RQ FLAGS: hff %d %d n %d g %d s %d newtflag %d\n",
|
||||
// rq->half,rq->full,rq->newton,rq->ghost,rq->ssa,
|
||||
// newtflag);
|
||||
@ -2084,7 +2104,7 @@ void Neighbor::build(int topoflag)
|
||||
}
|
||||
|
||||
// bin atoms for all NBin instances
|
||||
// not just NBin associated with perpetual lists
|
||||
// not just NBin associated with perpetual lists, also occasional lists
|
||||
// b/c cannot wait to bin occasional lists in build_one() call
|
||||
// if bin then, atoms may have moved outside of proc domain & bin extent,
|
||||
// leading to errors or even a crash
|
||||
@ -2190,6 +2210,7 @@ void Neighbor::build_one(class NeighList *mylist, int preflag)
|
||||
|
||||
// build the list
|
||||
|
||||
if (!mylist->copy) mylist->grow(atom->nlocal,atom->nlocal+atom->nghost);
|
||||
np->build_setup();
|
||||
np->build(mylist);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user