From be38ef0eb09a9156a85afb014ed1268610685076 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 12 Sep 2019 15:26:02 -0400 Subject: [PATCH] make native dump reader compatible with dump files containing ITEM: UNITS --- src/reader_native.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/reader_native.cpp b/src/reader_native.cpp index fba613bdd3..a4b188be5f 100644 --- a/src/reader_native.cpp +++ b/src/reader_native.cpp @@ -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; }