simplify. avoid XXXINT_FORMAT macros

This commit is contained in:
Axel Kohlmeyer
2022-03-30 22:13:05 -04:00
parent 1c9dc9c0d9
commit b64e90dfe0
12 changed files with 175 additions and 246 deletions

View File

@ -130,10 +130,10 @@ int DumpXYZ::modify_param(int narg, char **arg)
void DumpXYZ::write_header(bigint n)
{
if (me == 0) {
if (time_flag) {
double tcurrent = update->atime + (update->ntimestep-update->atimestep) + update->dt;
fmt::print(fp,"{}\n Atoms. Timestep: {} Time: {:.6f}\n", n, update->ntimestep, tcurrent);
} else fmt::print(fp,"{}\n Atoms. Timestep: {}\n", n, update->ntimestep);
auto header = fmt::format("{}\n Atoms. Timestep: {}", n, update->ntimestep);
if (time_flag) header += fmt::format(" Time: {:.6f}", compute_time());
header += "\n";
fmt::print(fp, header);
}
}