molecule fragment: let's add more checks

This commit is contained in:
Jacob Gissinger
2020-09-23 10:37:33 -04:00
parent ed3975054a
commit 1be766c8cd

View File

@ -535,6 +535,8 @@ void Molecule::read(int flag)
if (flag) molecules(line);
else skip_lines(natoms,line);
} else if (strcmp(keyword,"Fragments") == 0) {
if (nfragments == 0)
error->all(FLERR,"Molecule file has fragments but no nfragments setting");
fragmentflag = 1;
if (flag) fragments(line);
else skip_lines(nfragments,line);