simplify code

This commit is contained in:
Axel Kohlmeyer 2016-11-29 09:03:53 -05:00
parent 7d098bff90
commit 789e62388f
1 changed files with 4 additions and 4 deletions

View File

@ -343,10 +343,10 @@ void DihedralNHarmonic::read_restart(FILE *fp)
void DihedralNHarmonic::write_data(FILE *fp)
{
for (int i = 1; i <= atom->ndihedraltypes; i++) {
fprintf(fp, "%d %d ", i, nterms[i]);
for (int j = 0; j < nterms[i]; j++ ) {
fprintf(fp, (j < nterms[i] - 1) ? "%f " : "%f", a[i][j]);
}
fprintf(fp, "%d %d", i, nterms[i]);
for (int j = 0; j < nterms[i]; j++ )
fprintf(fp, " %g", a[i][j]);
fprintf(fp, "\n");
}