git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@14058 f3b2605a-c512-4ea7-a41b-209d697bcdaa

This commit is contained in:
sjplimp
2015-09-24 20:18:19 +00:00
parent 2ed7d366a6
commit 448b9f66f0
21 changed files with 910 additions and 187 deletions

View File

@ -56,11 +56,17 @@ int ReaderXYZ::read_time(bigint &ntimestep)
{
char *eof = fgets(line,MAXLINE,fp);
if (eof == NULL) return 1;
int n = strlen(line);
if (n > 0) line[n-1] = '\0'; // strip newline
// first line has to have the number of atoms
// truncate the string to the first whitespace,
// so force->bnumeric() does not hiccup
for (int i=0; (i < MAXLINE) && (eof[i] != '\0'); ++i) {
if (eof[i] == '\n' || eof[i] == '\r' || eof[i] == ' ' || eof[i] == '\t') {
eof[i] = '\0';
break;
}
}
natoms = force->bnumeric(FLERR,line);
if (natoms < 1)
error->one(FLERR,"Dump file is incorrectly formatted");