do error checking already in read_data code

This commit is contained in:
Axel Kohlmeyer
2021-12-31 14:34:09 -05:00
parent 863de683ee
commit c17a183816
2 changed files with 21 additions and 14 deletions

View File

@ -1643,19 +1643,11 @@ void Atom::data_bodies(int n, char *buf, AtomVec *avec_body, tagint id_offset)
ninteger = utils::inumeric(FLERR,values[1],false,lmp);
ndouble = utils::inumeric(FLERR,values[2],false,lmp);
if (tagdata <= 0 || tagdata > map_tag_max)
error->one(FLERR,"Invalid atom ID in Bodies section of data file");
if (unique_tags->find(tagdata) == unique_tags->end())
unique_tags->insert(tagdata);
else
error->one(FLERR,"Duplicate atom ID in Bodies section of data file");
if (ninteger < 0)
error->one(FLERR,"Invalid number of integers in Bodies section of data file");
if (ndouble < 0)
error->one(FLERR,"Invalid number of doubles in Bodies section of data file");
buf = next + 1;
m = map(tagdata);
if (m >= 0) {