git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@11052 f3b2605a-c512-4ea7-a41b-209d697bcdaa

This commit is contained in:
sjplimp 2013-11-22 22:15:48 +00:00
parent 13ebf5b7db
commit f447886276
3 changed files with 34 additions and 6 deletions

View File

@ -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;
}

View File

@ -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 *);

View File

@ -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;