support special case where number of data lines from fix is number of added atoms
This commit is contained in:
@ -325,12 +325,12 @@ void FixPropertyAtom::read_data_section(char *keyword, int n, char *buf, tagint
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* ----------------------------------------------------------------------
|
/* ----------------------------------------------------------------------
|
||||||
return # of lines in section of data file labeled by keyword
|
return # of lines in section of data file labeled by keyword. -1 signals use # of added atoms
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
bigint FixPropertyAtom::read_data_skip_lines(char * /*keyword*/)
|
bigint FixPropertyAtom::read_data_skip_lines(char * /*keyword*/)
|
||||||
{
|
{
|
||||||
return atom->natoms;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ----------------------------------------------------------------------
|
/* ----------------------------------------------------------------------
|
||||||
|
|||||||
@ -875,10 +875,13 @@ void ReadData::command(int narg, char **arg)
|
|||||||
int i;
|
int i;
|
||||||
for (i = 0; i < nfix; i++)
|
for (i = 0; i < nfix; i++)
|
||||||
if (strcmp(keyword, fix_section[i]) == 0) {
|
if (strcmp(keyword, fix_section[i]) == 0) {
|
||||||
if (firstpass)
|
if (firstpass) {
|
||||||
fix(fix_index[i], keyword);
|
fix(fix_index[i], keyword);
|
||||||
else
|
} else {
|
||||||
skip_lines(fix_index[i]->read_data_skip_lines(keyword));
|
auto nskip = fix_index[i]->read_data_skip_lines(keyword);
|
||||||
|
if (nskip < 0) nskip = natoms;
|
||||||
|
skip_lines(nskip);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (i == nfix)
|
if (i == nfix)
|
||||||
@ -2225,6 +2228,7 @@ void ReadData::fix(Fix *ifix, char *keyword)
|
|||||||
int nchunk, eof;
|
int nchunk, eof;
|
||||||
|
|
||||||
bigint nline = ifix->read_data_skip_lines(keyword);
|
bigint nline = ifix->read_data_skip_lines(keyword);
|
||||||
|
if (nline < 0) nline = natoms;
|
||||||
|
|
||||||
bigint nread = 0;
|
bigint nread = 0;
|
||||||
while (nread < nline) {
|
while (nread < nline) {
|
||||||
|
|||||||
Reference in New Issue
Block a user