Commit 2cd7cbd9 authored by Axel Kohlmeyer's avatar Axel Kohlmeyer
Browse files

correct cut-n-paste error, add docs

parent 8776b810
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -139,6 +139,11 @@ forces added by this fix in a consistent manner. I.e. there is a
decrease in potential energy when atoms move in the direction of the
added force.

The "fix_modify"_fix_modify.html {virial} option is supported by this
fix to add the contribution due to the interaction between
atoms and each wall to the system's virial as part of "thermodynamic
output"_thermo_style.html. The default is {virial no}

The "fix_modify"_fix_modify.html {respa} option is supported by this
fix. This allows to set at which level of the "r-RESPA"_run_style.html
integrator the fix is adding its forces. Default is the outermost
+13 −9
Original line number Diff line number Diff line
@@ -299,6 +299,7 @@ void FixAddForce::post_force(int vflag)
          v[5] = yvalue * unwrap[2];
          v_tally(i,v);
        }
      }

  // variable force, wrap with clear/add
  // potential energy = evar if defined, else 0.0
@@ -323,7 +324,7 @@ void FixAddForce::post_force(int vflag)

    modify->addstep_compute(update->ntimestep + 1);

    for (int i = 0; i < nlocal; i++)
    for (int i = 0; i < nlocal; i++) {
      if (mask[i] & groupbit) {
        if (region && !region->match(x[i][0],x[i][1],x[i][2])) continue;
        domain->unmap(x[i],image[i],unwrap);
@@ -331,8 +332,9 @@ void FixAddForce::post_force(int vflag)
        if (ystyle == ATOM) yvalue = sforce[i][1];
        if (zstyle == ATOM) zvalue = sforce[i][2];

        if (estyle == ATOM) foriginal[0] += sforce[i][3];
        else {
        if (estyle == ATOM) {
          foriginal[0] += sforce[i][3];
        } else {
          if (xstyle) foriginal[0] -= xvalue*unwrap[0];
          if (ystyle) foriginal[0] -= yvalue*unwrap[1];
          if (zstyle) foriginal[0] -= zvalue*unwrap[2];
@@ -340,21 +342,23 @@ void FixAddForce::post_force(int vflag)
        foriginal[1] += f[i][0];
        foriginal[2] += f[i][1];
        foriginal[3] += f[i][2];

        if (xstyle) f[i][0] += xvalue;
        if (ystyle) f[i][1] += yvalue;
        if (zstyle) f[i][2] += zvalue;
        if (evflag) {
          v[0] = xstyle ? fx*unwrap[0] : 0.0;
          v[1] = ystyle ? fy*unwrap[1] : 0.0;
          v[2] = zstyle ? fz*unwrap[2] : 0.0;
          v[3] = xstyle ? fx*unwrap[1] : 0.0;
          v[4] = xstyle ? fx*unwrap[2] : 0.0;
          v[5] = ystyle ? fy*unwrap[2] : 0.0;
          v[0] = xstyle ? xvalue*unwrap[0] : 0.0;
          v[1] = ystyle ? yvalue*unwrap[1] : 0.0;
          v[2] = zstyle ? zvalue*unwrap[2] : 0.0;
          v[3] = xstyle ? xvalue*unwrap[1] : 0.0;
          v[4] = xstyle ? xvalue*unwrap[2] : 0.0;
          v[5] = ystyle ? yvalue*unwrap[2] : 0.0;
          v_tally(i, v);
        }
      }
    }
  }
}

/* ---------------------------------------------------------------------- */