make xyz dumps print out current simulation time
This commit is contained in:
@ -94,11 +94,14 @@ void DumpXYZGZ::write_header(bigint ndump)
|
|||||||
{
|
{
|
||||||
if (me == 0) {
|
if (me == 0) {
|
||||||
std::string header = fmt::format("{}\n", ndump);
|
std::string header = fmt::format("{}\n", ndump);
|
||||||
if (time_flag)
|
if (time_flag) {
|
||||||
header += fmt::format("Atoms. Timestep: {} Time: {:.6f}\n",
|
double tcurrent = update->atime +
|
||||||
update->ntimestep, update->atime);
|
(update->ntimestep-update->atimestep) + update->dt;
|
||||||
else
|
fprintf(fp,"Atoms. Timestep: " BIGINT_FORMAT " Time: %f\n",
|
||||||
|
update->ntimestep, tcurrent);
|
||||||
|
} else {
|
||||||
header += fmt::format("Atoms. Timestep: {}\n", update->ntimestep);
|
header += fmt::format("Atoms. Timestep: {}\n", update->ntimestep);
|
||||||
|
}
|
||||||
writer.write(header.c_str(), header.length());
|
writer.write(header.c_str(), header.length());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -96,15 +96,20 @@ void DumpXYZZstd::openfile()
|
|||||||
if (multifile) delete[] filecurrent;
|
if (multifile) delete[] filecurrent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
void DumpXYZZstd::write_header(bigint ndump)
|
void DumpXYZZstd::write_header(bigint ndump)
|
||||||
{
|
{
|
||||||
if (me == 0) {
|
if (me == 0) {
|
||||||
std::string header = fmt::format("{}\n", ndump);
|
std::string header = fmt::format("{}\n", ndump);
|
||||||
if (time_flag)
|
if (time_flag) {
|
||||||
header += fmt::format("Atoms. Timestep: {} Time: {:.6f}\n",
|
double tcurrent = update->atime +
|
||||||
update->ntimestep, update->atime);
|
(update->ntimestep-update->atimestep) + update->dt;
|
||||||
else
|
fprintf(fp,"Atoms. Timestep: " BIGINT_FORMAT " Time: %f\n",
|
||||||
header += fmt::format("Atoms. Timestep: {}\n", update->ntimestep);
|
update->ntimestep, tcurrent);
|
||||||
|
} else {
|
||||||
|
fprintf(fp,"Atoms. Timestep: " BIGINT_FORMAT "\n",update->ntimestep);
|
||||||
|
}
|
||||||
writer.write(header.c_str(), header.length());
|
writer.write(header.c_str(), header.length());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -131,12 +131,15 @@ void DumpXYZ::write_header(bigint n)
|
|||||||
{
|
{
|
||||||
if (me == 0) {
|
if (me == 0) {
|
||||||
fprintf(fp,BIGINT_FORMAT "\n",n);
|
fprintf(fp,BIGINT_FORMAT "\n",n);
|
||||||
if (time_flag)
|
if (time_flag) {
|
||||||
|
double tcurrent = update->atime +
|
||||||
|
(update->ntimestep-update->atimestep) + update->dt;
|
||||||
fprintf(fp,"Atoms. Timestep: " BIGINT_FORMAT " Time: %f\n",
|
fprintf(fp,"Atoms. Timestep: " BIGINT_FORMAT " Time: %f\n",
|
||||||
update->ntimestep, update->atime);
|
update->ntimestep, tcurrent);
|
||||||
else
|
} else {
|
||||||
fprintf(fp,"Atoms. Timestep: " BIGINT_FORMAT "\n",update->ntimestep);
|
fprintf(fp,"Atoms. Timestep: " BIGINT_FORMAT "\n",update->ntimestep);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|||||||
Reference in New Issue
Block a user