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

This commit is contained in:
sjplimp 2007-10-11 23:09:11 +00:00
parent ed3aa9dca1
commit 14458f1506
4 changed files with 30 additions and 10 deletions

View File

@ -192,7 +192,7 @@ void Neighbor::skip_from(NeighList *list)
for (ii = 0; ii < inum_skip; ii++) {
i = ilist_skip[ii];
itype = type[i];
if (iskip[type[i]]) continue;
if (iskip[itype]) continue;
if (pgsize - npnt < oneatom) {
npnt = 0;
@ -273,7 +273,7 @@ void Neighbor::skip_from_granular(NeighList *list)
for (ii = 0; ii < inum_skip; ii++) {
i = ilist_skip[ii];
itype = type[i];
if (iskip[type[i]]) continue;
if (iskip[itype]) continue;
if (pgsize - npnt < oneatom) {
npnt = 0;
@ -384,7 +384,7 @@ void Neighbor::skip_from_respa(NeighList *list)
for (ii = 0; ii < inum_skip; ii++) {
i = ilist_skip[ii];
itype = type[i];
if (iskip[type[i]]) continue;
if (iskip[itype]) continue;
if (pgsize - npnt < oneatom) {
npnt = 0;

View File

@ -83,6 +83,9 @@ NeighList::~NeighList()
}
}
delete [] iskip;
memory->destroy_2d_int_array(ijskip);
if (maxstencil) memory->sfree(stencil);
if (maxstencil_multi) {
for (int i = 1; i <= atom->ntypes; i++) {
@ -190,6 +193,23 @@ int **NeighList::add_pages()
return pages;
}
/* ----------------------------------------------------------------------
copy skip info from request rq into list's iskip,ijskip
------------------------------------------------------------------------- */
void NeighList::copy_skip_info(int *rq_iskip, int **rq_ijskip)
{
int ntypes = atom->ntypes;
iskip = new int[ntypes+1];
ijskip = memory->create_2d_int_array(ntypes+1,ntypes+1,
"neigh_list:ijskip");
int i,j;
for (i = 1; i <= ntypes; i++) iskip[i] = rq_iskip[i];
for (i = 1; i <= ntypes; i++)
for (j = 1; j <= ntypes; j++)
ijskip[i][j] = rq_ijskip[i][j];
}
/* ----------------------------------------------------------------------
print attributes of this list and associated request
------------------------------------------------------------------------- */

View File

@ -73,10 +73,11 @@ class NeighList : protected Pointers {
NeighList(class LAMMPS *, int);
~NeighList();
void grow(int); // grow maxlocal
void stencil_allocate(int, int); // allocate stencil arrays
int **add_pages(); // add pages to neigh list
void print_attributes(); // debug routine
void grow(int); // grow maxlocal
void stencil_allocate(int, int); // allocate stencil arrays
int **add_pages(); // add pages to neigh list
void copy_skip_info(int *, int **); // copy skip info from a neigh request
void print_attributes(); // debug routine
double memory_usage();
private:

View File

@ -432,7 +432,7 @@ void Neighbor::init()
// detect lists that are connected to other lists
// if-the-else sequence is important
// since don't want to re-process skip or copy lists further down
// skip: point this list at request->otherlist, copy skip ptrs from request
// skip: point this list at request->otherlist, copy skip info from request
// copy: point this list at request->otherlist
// half_from_full: point this list at preceeding full list
// granhistory: set preceeding list's listgranhistory to this list
@ -455,8 +455,7 @@ void Neighbor::init()
for (i = 0; i < nlist; i++) {
if (requests[i]->skip) {
lists[i]->listskip = lists[requests[i]->otherlist];
lists[i]->iskip = requests[i]->iskip;
lists[i]->ijskip = requests[i]->ijskip;
lists[i]->copy_skip_info(requests[i]->iskip,requests[i]->ijskip);
} else if (requests[i]->copy)
lists[i]->listcopy = lists[requests[i]->otherlist];