Merge branch 'time-dumps2' of github.com:lammps/lammps into time-dumps2

This commit is contained in:
Axel Kohlmeyer
2021-12-23 14:34:00 -05:00
3 changed files with 3 additions and 2 deletions

View File

@ -102,7 +102,7 @@ void DumpXYZZstd::write_header(bigint ndump)
{ {
if (me == 0) { if (me == 0) {
auto header = fmt::format("{}\n", ndump); auto header = fmt::format("{}\n", ndump);
if (time_flag && (update->whichflag == 1)) { if (time_flag) {
double tcurrent = update->atime + (update->ntimestep-update->atimestep) + update->dt; double tcurrent = update->atime + (update->ntimestep-update->atimestep) + update->dt;
header += fmt::format("Atoms. Timestep: {} Time: {:.6f}\n", update->ntimestep, tcurrent); header += fmt::format("Atoms. Timestep: {} Time: {:.6f}\n", update->ntimestep, tcurrent);
} else header += fmt::format("Atoms. Timestep: {}\n", update->ntimestep); } else header += fmt::format("Atoms. Timestep: {}\n", update->ntimestep);

View File

@ -1132,6 +1132,7 @@ double Dump::compute_time()
{ {
return update->atime + (update->ntimestep - update->atimestep)*update->dt; return update->atime + (update->ntimestep - update->atimestep)*update->dt;
} }
/* ---------------------------------------------------------------------- /* ----------------------------------------------------------------------
return # of bytes of allocated memory return # of bytes of allocated memory
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */

View File

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