add support for optionally including unit information in standard dump files
This commit is contained in:
11
src/dump.cpp
11
src/dump.cpp
@ -87,6 +87,8 @@ Dump::Dump(LAMMPS *lmp, int /*narg*/, char **arg) : Pointers(lmp)
|
||||
buffer_flag = 0;
|
||||
padflag = 0;
|
||||
pbcflag = 0;
|
||||
unit_flag = 0;
|
||||
unit_count = 0;
|
||||
delay_flag = 0;
|
||||
|
||||
maxfiles = -1;
|
||||
@ -545,6 +547,8 @@ void Dump::openfile()
|
||||
if (singlefile_opened) return;
|
||||
if (multifile == 0) singlefile_opened = 1;
|
||||
|
||||
unit_count = 0;
|
||||
|
||||
// if one file per timestep, replace '*' with current timestep
|
||||
|
||||
char *filecurrent = filename;
|
||||
@ -1119,6 +1123,13 @@ void Dump::modify_params(int narg, char **arg)
|
||||
}
|
||||
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;
|
||||
else if (strcmp(arg[iarg+1],"no") == 0) unit_flag = 0;
|
||||
else error->all(FLERR,"Illegal dump_modify command");
|
||||
iarg += 2;
|
||||
|
||||
} else {
|
||||
int n = modify_param(narg-iarg,&arg[iarg]);
|
||||
if (n == 0) error->all(FLERR,"Illegal dump_modify command");
|
||||
|
||||
Reference in New Issue
Block a user