fix logic bug when writing coeffs to data file

This commit is contained in:
Axel Kohlmeyer
2025-03-25 03:02:17 -04:00
parent 5a62d0a129
commit 7fba02f865

View File

@ -473,7 +473,8 @@ void PairDPDCoulSlaterLong::read_restart_settings(FILE *fp)
void PairDPDCoulSlaterLong::write_data(FILE *fp)
{
for (int i = 1; i <= atom->ntypes; i++)
fprintf(fp,"%d %g %g\n",i,a0[i][i],gamma[i][i]);
fprintf(fp,"%d %g %g %s %g\n",i,a0[i][i],gamma[i][i],
(cut_slatersq[i][i] == 0.0) ? "no" : "yes", cut_dpd[i][i]);
}
/* ----------------------------------------------------------------------
@ -485,7 +486,7 @@ void PairDPDCoulSlaterLong::write_data_all(FILE *fp)
for (int i = 1; i <= atom->ntypes; i++)
for (int j = i; j <= atom->ntypes; j++)
fprintf(fp,"%d %d %g %g %s %g\n",i,j,a0[i][j],gamma[i][j],
(cut_slatersq[i][j] == 0.0) ? "yes" : "no", cut_dpd[i][j]);
(cut_slatersq[i][j] == 0.0) ? "no" : "yes", cut_dpd[i][j]);
}
/* ---------------------------------------------------------------------- */