git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@13644 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
@ -182,7 +182,7 @@ class Fix : protected Pointers {
|
||||
virtual void reset_dt() {}
|
||||
|
||||
virtual void read_data_header(char *) {}
|
||||
virtual void read_data_section(char *, int, char *) {}
|
||||
virtual void read_data_section(char *, int, char *, tagint) {}
|
||||
virtual bigint read_data_skip_lines(char *) {return 0;}
|
||||
|
||||
virtual void write_data_header(FILE *, int) {}
|
||||
|
||||
@ -182,9 +182,11 @@ void FixPropertyAtom::init()
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
unpack N lines in buf from section of data file labeled by keyword
|
||||
id_offset is applied to first atomID field if multiple data files are read
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void FixPropertyAtom::read_data_section(char *keyword, int n, char *buf)
|
||||
void FixPropertyAtom::read_data_section(char *keyword, int n, char *buf,
|
||||
tagint id_offset)
|
||||
{
|
||||
int j,m;
|
||||
tagint itag;
|
||||
@ -223,7 +225,7 @@ void FixPropertyAtom::read_data_section(char *keyword, int n, char *buf)
|
||||
for (j = 1; j < nwords; j++)
|
||||
values[j] = strtok(NULL," \t\n\r\f");
|
||||
|
||||
itag = ATOTAGINT(values[0]);
|
||||
itag = ATOTAGINT(values[0]) + id_offset;
|
||||
if (itag <= 0 || itag > map_tag_max) {
|
||||
char str[128];
|
||||
sprintf(str,"Invalid atom ID in %s section of data file",keyword);
|
||||
|
||||
@ -31,7 +31,7 @@ class FixPropertyAtom : public Fix {
|
||||
int setmask();
|
||||
void init();
|
||||
|
||||
void read_data_section(char *, int, char *);
|
||||
void read_data_section(char *, int, char *, tagint);
|
||||
bigint read_data_skip_lines(char *);
|
||||
void write_data_section_size(int, int &, int &);
|
||||
void write_data_section_pack(int, double **);
|
||||
|
||||
@ -1681,7 +1681,7 @@ void ReadData::fix(int ifix, char *keyword)
|
||||
nchunk = MIN(nline-nread,CHUNK);
|
||||
eof = comm->read_lines_from_file(fp,nchunk,MAXLINE,buffer);
|
||||
if (eof) error->all(FLERR,"Unexpected end of data file");
|
||||
modify->fix[ifix]->read_data_section(keyword,nchunk,buffer);
|
||||
modify->fix[ifix]->read_data_section(keyword,nchunk,buffer,id_offset);
|
||||
nread += nchunk;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user