git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@10315 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
@ -154,10 +154,13 @@ void FixShearHistory::pre_exchange()
|
|||||||
int *touch,**firsttouch;
|
int *touch,**firsttouch;
|
||||||
double *shear,*allshear,**firstshear;
|
double *shear,*allshear,**firstshear;
|
||||||
|
|
||||||
|
// nlocal may include atoms added since last neigh build
|
||||||
|
|
||||||
|
int nlocal = atom->nlocal;
|
||||||
|
|
||||||
// zero npartner for all current atoms
|
// zero npartner for all current atoms
|
||||||
// clear 2 page data structures
|
// clear 2 page data structures
|
||||||
|
|
||||||
int nlocal = atom->nlocal;
|
|
||||||
for (i = 0; i < nlocal; i++) npartner[i] = 0;
|
for (i = 0; i < nlocal; i++) npartner[i] = 0;
|
||||||
|
|
||||||
ipage->reset();
|
ipage->reset();
|
||||||
@ -165,6 +168,7 @@ void FixShearHistory::pre_exchange()
|
|||||||
|
|
||||||
// 1st loop over neighbor list
|
// 1st loop over neighbor list
|
||||||
// calculate npartner for each owned atom
|
// calculate npartner for each owned atom
|
||||||
|
// nlocal_neigh = nlocal when neigh list was built, may be smaller than nlocal
|
||||||
|
|
||||||
int *tag = atom->tag;
|
int *tag = atom->tag;
|
||||||
NeighList *list = pair->list;
|
NeighList *list = pair->list;
|
||||||
@ -175,6 +179,9 @@ void FixShearHistory::pre_exchange()
|
|||||||
firsttouch = list->listgranhistory->firstneigh;
|
firsttouch = list->listgranhistory->firstneigh;
|
||||||
firstshear = list->listgranhistory->firstdouble;
|
firstshear = list->listgranhistory->firstdouble;
|
||||||
|
|
||||||
|
int nlocal_neigh = 0;
|
||||||
|
if (inum) nlocal_neigh = ilist[inum-1] + 1;
|
||||||
|
|
||||||
for (ii = 0; ii < inum; ii++) {
|
for (ii = 0; ii < inum; ii++) {
|
||||||
i = ilist[ii];
|
i = ilist[ii];
|
||||||
jlist = firstneigh[i];
|
jlist = firstneigh[i];
|
||||||
@ -186,7 +193,7 @@ void FixShearHistory::pre_exchange()
|
|||||||
npartner[i]++;
|
npartner[i]++;
|
||||||
j = jlist[jj];
|
j = jlist[jj];
|
||||||
j &= NEIGHMASK;
|
j &= NEIGHMASK;
|
||||||
if (j < nlocal) npartner[j]++;
|
if (j < nlocal_neigh) npartner[j]++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -226,7 +233,7 @@ void FixShearHistory::pre_exchange()
|
|||||||
shearpartner[i][m][1] = shear[1];
|
shearpartner[i][m][1] = shear[1];
|
||||||
shearpartner[i][m][2] = shear[2];
|
shearpartner[i][m][2] = shear[2];
|
||||||
npartner[i]++;
|
npartner[i]++;
|
||||||
if (j < nlocal) {
|
if (j < nlocal_neigh) {
|
||||||
m = npartner[j];
|
m = npartner[j];
|
||||||
partner[j][m] = tag[i];
|
partner[j][m] = tag[i];
|
||||||
shearpartner[j][m][0] = -shear[0];
|
shearpartner[j][m][0] = -shear[0];
|
||||||
|
|||||||
Reference in New Issue
Block a user