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

This commit is contained in:
sjplimp
2013-02-09 19:31:37 +00:00
parent 99f80bff9f
commit 2b5425cec7
4 changed files with 13 additions and 7 deletions

View File

@ -189,11 +189,13 @@ void BondHarmonicShift::read_restart(FILE *fp)
/* ---------------------------------------------------------------------- */
double BondHarmonicShift::single(int type, double rsq, int i, int j)
double BondHarmonicShift::single(int type, double rsq, int i, int j,
double &fforce)
{
double r = sqrt(rsq);
double dr = r - r0[type];
double dr2=r0[type]-r1[type];
fforce = -2.0*k[type]*dr/r;
return k[type]*(dr*dr - dr2*dr2);
}