make native dump reader compatible with dump files containing ITEM: UNITS

This commit is contained in:
Axel Kohlmeyer
2019-09-12 15:26:02 -04:00
parent 0c52a7ed70
commit be38ef0eb0

View File

@ -56,12 +56,19 @@ int ReaderNative::read_time(bigint &ntimestep)
char *eof = fgets(line,MAXLINE,fp);
if (eof == NULL) return 1;
// skip over unit information, if present.
if (strstr(line,"ITEM: UNITS") == line)
read_lines(2);
if (strstr(line,"ITEM: TIMESTEP") != line)
error->one(FLERR,"Dump file is incorrectly formatted");
read_lines(1);
int rv = sscanf(line,BIGINT_FORMAT,&ntimestep);
if (rv != 1)
error->one(FLERR,"Dump file is incorrectly formatted");
return 0;
}