From f447886276f8db2120733cdd4a7265f72eca0ac0 Mon Sep 17 00:00:00 2001 From: sjplimp Date: Fri, 22 Nov 2013 22:15:48 +0000 Subject: [PATCH] git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@11052 f3b2605a-c512-4ea7-a41b-209d697bcdaa --- src/neigh_request.cpp | 24 +++++++++++++++++++----- src/neigh_request.h | 9 +++++++++ src/neighbor.cpp | 7 ++++++- 3 files changed, 34 insertions(+), 6 deletions(-) diff --git a/src/neigh_request.cpp b/src/neigh_request.cpp index 9b82b5531a..5c362d29d8 100644 --- a/src/neigh_request.cpp +++ b/src/neigh_request.cpp @@ -71,9 +71,23 @@ NeighRequest::~NeighRequest() memory->destroy(ijskip); } +/* ---------------------------------------------------------------------- + archive request params that Neighbor may change after call to identical() +------------------------------------------------------------------------- */ + +void NeighRequest::archive() +{ + half_original = half; + half_from_full_original = half_from_full; + copy_original = copy; + otherlist_original = otherlist; +} + /* ---------------------------------------------------------------------- compare this request to other request - return 1 if every variable is same, 0 if different in any way + identical means all params set by requestor are the same + compare to original values in other if Neighbor may have changed them + return 1 if identical, 0 if not ------------------------------------------------------------------------- */ int NeighRequest::identical(NeighRequest *other) @@ -88,14 +102,14 @@ int NeighRequest::identical(NeighRequest *other) if (compute != other->compute) same = 0; if (command != other->command) same = 0; - if (half != other->half) same = 0; + if (half != other->half_original) same = 0; if (full != other->full) same = 0; if (gran != other->gran) same = 0; if (granhistory != other->granhistory) same = 0; if (respainner != other->respainner) same = 0; if (respamiddle != other->respamiddle) same = 0; if (respaouter != other->respaouter) same = 0; - if (half_from_full != other->half_from_full) same = 0; + if (half_from_full != other->half_from_full_original) same = 0; if (newton != other->newton) same = 0; if (occasional != other->occasional) same = 0; @@ -105,9 +119,9 @@ int NeighRequest::identical(NeighRequest *other) if (cudable != other->cudable) same = 0; if (omp != other->omp) same = 0; - if (copy != other->copy) same = 0; + if (copy != other->copy_original) same = 0; if (same_skip(other) == 0) same = 0; - if (otherlist != other->otherlist) same = 0; + if (otherlist != other->otherlist_original) same = 0; return same; } diff --git a/src/neigh_request.h b/src/neigh_request.h index af3e39839d..e16c2df814 100644 --- a/src/neigh_request.h +++ b/src/neigh_request.h @@ -91,10 +91,19 @@ class NeighRequest : protected Pointers { int otherlist; // index of other list to copy or skip from + // original params by requester + // stored to compare against in identical() in case Neighbor changes them + + int half_original; + int half_from_full_original; + int copy_original; + int otherlist_original; + // methods NeighRequest(class LAMMPS *); ~NeighRequest(); + void archive(); int identical(NeighRequest *); int same_kind(NeighRequest *); int same_skip(NeighRequest *); diff --git a/src/neighbor.cpp b/src/neighbor.cpp index ea1a7cdc00..10f7ce0a10 100644 --- a/src/neighbor.cpp +++ b/src/neighbor.cpp @@ -233,6 +233,7 @@ void Neighbor::init() // needs to be non-zero for migration distance check // even if pair = NULL and no neighbor lists are used // cutneigh = force cutoff + skin if cutforce > 0, else cutneigh = 0 + // cutneighghost = pair cutghost if it requests it, else same as cutneigh triggersq = 0.25*skin*skin; boxcheck = 0; @@ -270,7 +271,7 @@ void Neighbor::init() if (force->pair && force->pair->ghostneigh) { cut = force->pair->cutghost[i][j] + skin; cutneighghostsq[i][j] = cut*cut; - } + } else cutneighghostsq[i][j] = cut*cut; } } cutneighmaxsq = cutneighmax * cutneighmax; @@ -435,6 +436,10 @@ void Neighbor::init() // no need to re-create if: // neigh style, triclinic, pgsize, oneatom have not changed // current requests = old requests + // first archive request params for current requests + // before Neighbor possibly changes them below + + for (i = 0; i < nrequest; i++) requests[i]->archive(); int same = 1; if (style != old_style) same = 0;