git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@9429 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user