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

This commit is contained in:
sjplimp 2014-05-02 14:29:05 +00:00
parent af5d91115f
commit a1c6c99ccc
3 changed files with 18 additions and 15 deletions

View File

@ -259,6 +259,14 @@ void FixEfield::post_force(int vflag)
memory->create(efield,maxatom,4,"efield:efield");
}
// update region if necessary
Region *region = NULL;
if (iregion >= 0) {
region = domain->regions[iregion];
region->prematch();
}
// fsum[0] = "potential energy" for added force
// fsum[123] = extra force added to atoms
@ -279,9 +287,7 @@ void FixEfield::post_force(int vflag)
if (qflag) {
for (int i = 0; i < nlocal; i++)
if (mask[i] & groupbit) {
if (iregion >= 0 &&
!domain->regions[iregion]->match(x[i][0],x[i][1],x[i][2]))
continue;
if (region && !region->match(x[i][0],x[i][1],x[i][2])) continue;
fx = q[i]*ex;
fy = q[i]*ey;
fz = q[i]*ez;
@ -306,9 +312,7 @@ void FixEfield::post_force(int vflag)
double tx,ty,tz;
for (int i = 0; i < nlocal; i++)
if (mask[i] & groupbit) {
if (iregion >= 0 &&
!domain->regions[iregion]->match(x[i][0],x[i][1],x[i][2]))
continue;
if (region && !region->match(x[i][0],x[i][1],x[i][2])) continue;
tx = ez*mu[i][1] - ey*mu[i][2];
ty = ex*mu[i][2] - ez*mu[i][0];
tz = ey*mu[i][0] - ex*mu[i][1];
@ -354,9 +358,7 @@ void FixEfield::post_force(int vflag)
if (qflag) {
for (int i = 0; i < nlocal; i++)
if (mask[i] & groupbit) {
if (iregion >= 0 &&
!domain->regions[iregion]->match(x[i][0],x[i][1],x[i][2]))
continue;
if (region && !region->match(x[i][0],x[i][1],x[i][2])) continue;
if (xstyle == ATOM) fx = qe2f * q[i]*efield[i][0];
else fx = q[i]*ex;
f[i][0] += fx;
@ -382,9 +384,7 @@ void FixEfield::post_force(int vflag)
double tx,ty,tz;
for (int i = 0; i < nlocal; i++)
if (mask[i] & groupbit) {
if (iregion >= 0 &&
!domain->regions[iregion]->match(x[i][0],x[i][1],x[i][2]))
continue;
if (region && !region->match(x[i][0],x[i][1],x[i][2])) continue;
tx = ez*mu[i][1] - ey*mu[i][2];
ty = ex*mu[i][2] - ez*mu[i][0];
tz = ey*mu[i][0] - ex*mu[i][1];

View File

@ -185,6 +185,9 @@ void FixEvaporate::pre_exchange()
// nbefore = # on procs before me
// list[ncount] = list of local indices of atoms I can delete
Region *region = domain->regions[iregion];
region->prematch();
double **x = atom->x;
int *mask = atom->mask;
tagint *tag = atom->tag;
@ -193,8 +196,7 @@ void FixEvaporate::pre_exchange()
int ncount = 0;
for (i = 0; i < nlocal; i++)
if (mask[i] & groupbit)
if (domain->regions[iregion]->match(x[i][0],x[i][1],x[i][2]))
list[ncount++] = i;
if (region->match(x[i][0],x[i][1],x[i][2])) list[ncount++] = i;
int nall,nbefore;
MPI_Allreduce(&ncount,&nall,1,MPI_INT,MPI_SUM,world);

View File

@ -89,8 +89,9 @@ void FixOneWay::init()
void FixOneWay::end_of_step()
{
Region *region = domain->regions[regionidx];
const int idx = direction & XYZMASK;
region->prematch();
const int idx = direction & XYZMASK;
const double * const * const x = atom->x;
double * const * const v = atom->v;
const int *mask = atom->mask;