From ad6d4018067af3eddef247b3ebdc217357ca05e4 Mon Sep 17 00:00:00 2001 From: sjplimp Date: Tue, 22 Sep 2009 23:08:40 +0000 Subject: [PATCH] git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@3165 f3b2605a-c512-4ea7-a41b-209d697bcdaa --- src/comm.cpp | 21 +++++++++++++-------- src/fix_deform.cpp | 3 +-- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/src/comm.cpp b/src/comm.cpp index 01b0123810..2218950985 100644 --- a/src/comm.cpp +++ b/src/comm.cpp @@ -984,8 +984,9 @@ void Comm::reverse_comm_compute(Compute *compute) can be used in place of exchange() unlike exchange(), allows atoms to have moved arbitrarily long distances first setup irregular comm pattern, then invoke it - for triclinic, - atoms must be in lamda coords (0-1) before irregular is called + atoms must be remapped to be inside simulation box before this is called + for triclinic: + atoms must be in lamda coords (0-1) before this is called ------------------------------------------------------------------------- */ void Comm::irregular() @@ -1012,6 +1013,8 @@ void Comm::irregular() // loop over atoms, flag any that are not in my sub-box // fill buffer with atoms leaving my box, using < and >= // assign which proc it belongs to via irregular_lookup() + // if irregular_lookup() returns me, due to round-off + // in triclinic x2lamda(), then keep atom and don't send // when atom is deleted, fill it in with last atom AtomVec *avec = atom->avec; @@ -1028,13 +1031,15 @@ void Comm::irregular() if (x[i][0] < sublo[0] || x[i][0] >= subhi[0] || x[i][1] < sublo[1] || x[i][1] >= subhi[1] || x[i][2] < sublo[2] || x[i][2] >= subhi[2]) { - if (nsend > maxsend) grow_send(nsend,1); - sizes[nsendatom] = avec->pack_exchange(i,&buf_send[nsend]); - nsend += sizes[nsendatom]; proclist[nsendatom] = irregular_lookup(x[i]); - nsendatom++; - avec->copy(nlocal-1,i); - nlocal--; + if (proclist[nsendatom] != me) { + if (nsend > maxsend) grow_send(nsend,1); + sizes[nsendatom] = avec->pack_exchange(i,&buf_send[nsend]); + nsend += sizes[nsendatom]; + nsendatom++; + avec->copy(nlocal-1,i); + nlocal--; + } else i++; } else i++; } atom->nlocal = nlocal; diff --git a/src/fix_deform.cpp b/src/fix_deform.cpp index ae92ee80d7..10aeb26130 100644 --- a/src/fix_deform.cpp +++ b/src/fix_deform.cpp @@ -562,8 +562,7 @@ void FixDeform::pre_exchange() double **x = atom->x; int *image = atom->image; int nlocal = atom->nlocal; - for (int i = 0; i < nlocal; i++) - domain->remap(x[i],image[i]); + for (int i = 0; i < nlocal; i++) domain->remap(x[i],image[i]); domain->x2lamda(atom->nlocal); comm->irregular();