use compute_time() func in xyz output
This commit is contained in:
@ -94,14 +94,11 @@ void DumpXYZGZ::write_header(bigint ndump)
|
||||
{
|
||||
if (me == 0) {
|
||||
std::string header = fmt::format("{}\n", ndump);
|
||||
if (time_flag) {
|
||||
double tcurrent = update->atime +
|
||||
(update->ntimestep-update->atimestep) + update->dt;
|
||||
if (time_flag)
|
||||
fprintf(fp,"Atoms. Timestep: " BIGINT_FORMAT " Time: %f\n",
|
||||
update->ntimestep, tcurrent);
|
||||
} else {
|
||||
update->ntimestep, compute_time());
|
||||
else
|
||||
header += fmt::format("Atoms. Timestep: {}\n", update->ntimestep);
|
||||
}
|
||||
writer.write(header.c_str(), header.length());
|
||||
}
|
||||
}
|
||||
|
||||
@ -102,14 +102,11 @@ void DumpXYZZstd::write_header(bigint ndump)
|
||||
{
|
||||
if (me == 0) {
|
||||
std::string header = fmt::format("{}\n", ndump);
|
||||
if (time_flag) {
|
||||
double tcurrent = update->atime +
|
||||
(update->ntimestep-update->atimestep) + update->dt;
|
||||
if (time_flag)
|
||||
fprintf(fp,"Atoms. Timestep: " BIGINT_FORMAT " Time: %f\n",
|
||||
update->ntimestep, tcurrent);
|
||||
} else {
|
||||
update->ntimestep, compute_time());
|
||||
else
|
||||
fprintf(fp,"Atoms. Timestep: " BIGINT_FORMAT "\n",update->ntimestep);
|
||||
}
|
||||
writer.write(header.c_str(), header.length());
|
||||
}
|
||||
}
|
||||
|
||||
@ -1132,6 +1132,7 @@ double Dump::compute_time()
|
||||
{
|
||||
return update->atime + (update->ntimestep - update->atimestep)*update->dt;
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
return # of bytes of allocated memory
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
@ -131,14 +131,12 @@ void DumpXYZ::write_header(bigint n)
|
||||
{
|
||||
if (me == 0) {
|
||||
fprintf(fp,BIGINT_FORMAT "\n",n);
|
||||
if (time_flag) {
|
||||
double tcurrent = update->atime +
|
||||
(update->ntimestep-update->atimestep) + update->dt;
|
||||
if (time_flag)
|
||||
fprintf(fp,"Atoms. Timestep: " BIGINT_FORMAT " Time: %f\n",
|
||||
update->ntimestep, tcurrent);
|
||||
} else {
|
||||
update->ntimestep, compute_time());
|
||||
else
|
||||
fprintf(fp,"Atoms. Timestep: " BIGINT_FORMAT "\n",update->ntimestep);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user