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

This commit is contained in:
sjplimp
2014-05-02 14:28:56 +00:00
parent c8fce1f525
commit af5d91115f
15 changed files with 125 additions and 80 deletions

View File

@ -189,6 +189,14 @@ void FixAveForce::min_setup(int vflag)
void FixAveForce::post_force(int vflag)
{
// update region if necessary
Region *region = NULL;
if (iregion >= 0) {
region = domain->regions[iregion];
region->prematch();
}
// sum forces on participating atoms
double **x = atom->x;
@ -201,10 +209,7 @@ void FixAveForce::post_force(int vflag)
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;
foriginal[0] += f[i][0];
foriginal[1] += f[i][1];
foriginal[2] += f[i][2];
@ -238,10 +243,7 @@ void FixAveForce::post_force(int vflag)
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) f[i][0] = fave[0];
if (ystyle) f[i][1] = fave[1];
if (zstyle) f[i][2] = fave[2];
@ -257,6 +259,12 @@ void FixAveForce::post_force_respa(int vflag, int ilevel, int iloop)
if (ilevel == nlevels_respa-1) post_force(vflag);
else {
Region *region = NULL;
if (iregion >= 0) {
region = domain->regions[iregion];
region->prematch();
}
double **x = atom->x;
double **f = atom->f;
int *mask = atom->mask;
@ -267,10 +275,7 @@ void FixAveForce::post_force_respa(int vflag, int ilevel, int iloop)
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;
foriginal[0] += f[i][0];
foriginal[1] += f[i][1];
foriginal[2] += f[i][2];
@ -289,10 +294,7 @@ void FixAveForce::post_force_respa(int vflag, int ilevel, int iloop)
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) f[i][0] = fave[0];
if (ystyle) f[i][1] = fave[1];
if (zstyle) f[i][2] = fave[2];