Skip to content
Snippets Groups Projects
Commit 2d0f5e27 authored by Steve Plimpton's avatar Steve Plimpton Committed by GitHub
Browse files

Merge pull request #704 from akohlmey/bond-gromos-bugfix

Compute energy correctly for bond style gromos
parents 260bbc6f 6b34a305
No related branches found
No related tags found
No related merge requests found
...@@ -81,7 +81,7 @@ void BondGromos::compute(int eflag, int vflag) ...@@ -81,7 +81,7 @@ void BondGromos::compute(int eflag, int vflag)
// force & energy // force & energy
fbond = -4.0 * kdr; fbond = -4.0 * kdr;
if (eflag) ebond = kdr; if (eflag) ebond = kdr*dr;
// apply force to each of 2 atoms // apply force to each of 2 atoms
...@@ -195,7 +195,7 @@ double BondGromos::single(int type, double rsq, int i, int j, ...@@ -195,7 +195,7 @@ double BondGromos::single(int type, double rsq, int i, int j,
{ {
double dr = rsq - r0[type]*r0[type]; double dr = rsq - r0[type]*r0[type];
fforce = -4.0*k[type] * dr; fforce = -4.0*k[type] * dr;
return k[type]*dr; return k[type]*dr*dr;
} }
/* ---------------------------------------------------------------------- /* ----------------------------------------------------------------------
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment