restrain energy must be incremented. bugfix from robert meissner posted to lammps-users

This commit is contained in:
Axel Kohlmeyer
2018-04-26 10:02:42 -04:00
parent 6f9a2245d2
commit 26d22a4b7a

View File

@ -261,7 +261,7 @@ void FixRestrain::restrain_bond(int m)
if (r > 0.0) fbond = -2.0*rk/r;
else fbond = 0.0;
energy = rk*dr;
energy += rk*dr;
// apply force to each of 2 atoms
@ -368,7 +368,7 @@ void FixRestrain::restrain_angle(int m)
dtheta = acos(c) - target[m];
tk = k * dtheta;
energy = tk*dtheta;
energy += tk*dtheta;
a = -2.0 * tk * s;
a11 = a*c / rsq1;
@ -549,7 +549,7 @@ void FixRestrain::restrain_dihedral(int m)
df1 *= -mult;
p += 1.0;
energy = k * p;
energy += k * p;
fg = vb1x*vb2xm + vb1y*vb2ym + vb1z*vb2zm;
hg = vb3x*vb2xm + vb3y*vb2ym + vb3z*vb2zm;