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

This commit is contained in:
sjplimp 2013-11-25 16:04:01 +00:00
parent 1f844fd910
commit 8fb13f4671
2 changed files with 9 additions and 4 deletions

View File

@ -195,8 +195,10 @@ void BondHarmonicShift::read_restart(FILE *fp)
void BondHarmonicShift::write_data(FILE *fp)
{
for (int i = 1; i <= atom->nbondtypes; i++)
fprintf(fp,"%d %g %g %g\n",i,k[i],r0[i],r1[i]);
for (int i = 1; i <= atom->nbondtypes; i++) {
double d2 = (r0[i]-r1[i])*(r0[i]-r1[i]);
fprintf(fp,"%d %g %g %g\n",i,k[i]*d2,r0[i],r1[i]);
}
}
/* ---------------------------------------------------------------------- */

View File

@ -117,6 +117,7 @@ void BondHarmonicShiftCut::allocate()
memory->create(r0, n+1,"bond:r0");
memory->create(r1, n+1,"bond:r1");
memory->create(setflag,n+1,"bond:setflag");
for (int i = 1; i <= n; i++) setflag[i] = 0;
}
@ -196,8 +197,10 @@ void BondHarmonicShiftCut::read_restart(FILE *fp)
void BondHarmonicShiftCut::write_data(FILE *fp)
{
for (int i = 1; i <= atom->nbondtypes; i++)
fprintf(fp,"%d %g %g %g\n",i,k[i],r0[i],r1[i]);
for (int i = 1; i <= atom->nbondtypes; i++) {
double d2 = (r0[i]-r1[i])*(r0[i]-r1[i]);
fprintf(fp,"%d %g %g %g\n",i,k[i]*d2,r0[i],r1[i]);
}
}
/* ---------------------------------------------------------------------- */