forked from lijiext/lammps
we need more specific matches to correctly handle TIME and TIMESTEP items
This commit is contained in:
parent
381ac888c8
commit
07c5adc57a
|
@ -17,6 +17,7 @@
|
||||||
#include "atom.h"
|
#include "atom.h"
|
||||||
#include "memory.h"
|
#include "memory.h"
|
||||||
#include "error.h"
|
#include "error.h"
|
||||||
|
#include "utils.h"
|
||||||
|
|
||||||
using namespace LAMMPS_NS;
|
using namespace LAMMPS_NS;
|
||||||
|
|
||||||
|
@ -58,13 +59,13 @@ int ReaderNative::read_time(bigint &ntimestep)
|
||||||
|
|
||||||
// skip over unit and time information, if present.
|
// skip over unit and time information, if present.
|
||||||
|
|
||||||
if (strstr(line,"ITEM: UNITS") == line)
|
if (utils::strmatch(line,"^\\s*ITEM: UNITS\\s*$"))
|
||||||
read_lines(2);
|
read_lines(2);
|
||||||
|
|
||||||
if (strstr(line,"ITEM: TIME") == line)
|
if (utils::strmatch(line,"^\\s*ITEM: TIME\\s*$"))
|
||||||
read_lines(2);
|
read_lines(2);
|
||||||
|
|
||||||
if (strstr(line,"ITEM: TIMESTEP") != line)
|
if (!utils::strmatch(line,"^\\s*ITEM: TIMESTEP\\s*$"))
|
||||||
error->one(FLERR,"Dump file is incorrectly formatted");
|
error->one(FLERR,"Dump file is incorrectly formatted");
|
||||||
|
|
||||||
read_lines(1);
|
read_lines(1);
|
||||||
|
|
Loading…
Reference in New Issue