add support for adding an ITEM: TIME output to some dump files

This commit is contained in:
Axel Kohlmeyer
2019-09-30 11:03:22 -04:00
parent 6cd460072b
commit 01214de6bd
8 changed files with 35 additions and 3 deletions

View File

@ -87,6 +87,7 @@ Dump::Dump(LAMMPS *lmp, int /*narg*/, char **arg) : Pointers(lmp)
buffer_flag = 0;
padflag = 0;
pbcflag = 0;
time_flag = 0;
unit_flag = 0;
unit_count = 0;
delay_flag = 0;
@ -1123,6 +1124,13 @@ void Dump::modify_params(int narg, char **arg)
}
iarg += 2;
} else if (strcmp(arg[iarg],"time") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal dump_modify command");
if (strcmp(arg[iarg+1],"yes") == 0) time_flag = 1;
else if (strcmp(arg[iarg+1],"no") == 0) time_flag = 0;
else error->all(FLERR,"Illegal dump_modify command");
iarg += 2;
} else if (strcmp(arg[iarg],"units") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal dump_modify command");
if (strcmp(arg[iarg+1],"yes") == 0) unit_flag = 1;
@ -1138,6 +1146,12 @@ void Dump::modify_params(int narg, char **arg)
}
}
/* ---------------------------------------------------------------------- */
double Dump::compute_time()
{
return update->atime + (update->ntimestep - update->atimestep)*update->dt;
}
/* ----------------------------------------------------------------------
return # of bytes of allocated memory
------------------------------------------------------------------------- */