correct cut-n-paste error, add docs

This commit is contained in:
Axel Kohlmeyer
2017-09-15 00:51:16 -04:00
parent 8776b81033
commit 2cd7cbd964
2 changed files with 18 additions and 9 deletions

View File

@ -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 decrease in potential energy when atoms move in the direction of the
added force. 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 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 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 integrator the fix is adding its forces. Default is the outermost

View File

@ -298,6 +298,7 @@ void FixAddForce::post_force(int vflag)
v[4] = xvalue * unwrap[2]; v[4] = xvalue * unwrap[2];
v[5] = yvalue * unwrap[2]; v[5] = yvalue * unwrap[2];
v_tally(i,v); v_tally(i,v);
}
} }
// variable force, wrap with clear/add // variable force, wrap with clear/add
@ -323,7 +324,7 @@ void FixAddForce::post_force(int vflag)
modify->addstep_compute(update->ntimestep + 1); 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 (mask[i] & groupbit) {
if (region && !region->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;
domain->unmap(x[i],image[i],unwrap); 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 (ystyle == ATOM) yvalue = sforce[i][1];
if (zstyle == ATOM) zvalue = sforce[i][2]; if (zstyle == ATOM) zvalue = sforce[i][2];
if (estyle == ATOM) foriginal[0] += sforce[i][3]; if (estyle == ATOM) {
else { foriginal[0] += sforce[i][3];
} else {
if (xstyle) foriginal[0] -= xvalue*unwrap[0]; if (xstyle) foriginal[0] -= xvalue*unwrap[0];
if (ystyle) foriginal[0] -= yvalue*unwrap[1]; if (ystyle) foriginal[0] -= yvalue*unwrap[1];
if (zstyle) foriginal[0] -= zvalue*unwrap[2]; if (zstyle) foriginal[0] -= zvalue*unwrap[2];
@ -340,19 +342,21 @@ void FixAddForce::post_force(int vflag)
foriginal[1] += f[i][0]; foriginal[1] += f[i][0];
foriginal[2] += f[i][1]; foriginal[2] += f[i][1];
foriginal[3] += f[i][2]; foriginal[3] += f[i][2];
if (xstyle) f[i][0] += xvalue; if (xstyle) f[i][0] += xvalue;
if (ystyle) f[i][1] += yvalue; if (ystyle) f[i][1] += yvalue;
if (zstyle) f[i][2] += zvalue; if (zstyle) f[i][2] += zvalue;
if (evflag) { if (evflag) {
v[0] = xstyle ? fx*unwrap[0] : 0.0; v[0] = xstyle ? xvalue*unwrap[0] : 0.0;
v[1] = ystyle ? fy*unwrap[1] : 0.0; v[1] = ystyle ? yvalue*unwrap[1] : 0.0;
v[2] = zstyle ? fz*unwrap[2] : 0.0; v[2] = zstyle ? zvalue*unwrap[2] : 0.0;
v[3] = xstyle ? fx*unwrap[1] : 0.0; v[3] = xstyle ? xvalue*unwrap[1] : 0.0;
v[4] = xstyle ? fx*unwrap[2] : 0.0; v[4] = xstyle ? xvalue*unwrap[2] : 0.0;
v[5] = ystyle ? fy*unwrap[2] : 0.0; v[5] = ystyle ? yvalue*unwrap[2] : 0.0;
v_tally(i, v); v_tally(i, v);
} }
} }
}
} }
} }