From e9a06a065451d82bc82e7c7a6b1b00f97ae9632e Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 22 Jun 2023 11:49:56 -0400 Subject: [PATCH] correct and reformat error messages for short reads --- src/read_data.cpp | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/src/read_data.cpp b/src/read_data.cpp index 2fea75f7c0..e3087ae215 100644 --- a/src/read_data.cpp +++ b/src/read_data.cpp @@ -2021,9 +2021,7 @@ void ReadData::pairIJcoeffs() if (eof) error->all(FLERR, "Unexpected end of data file"); if (tlabelflag && !lmap->is_complete(Atom::ATOM)) - error->all(FLERR, - "Label map is incomplete: " - "all types must be assigned a unique type label"); + error->all(FLERR,"Label map is incomplete: all types must be assigned a unique type label"); char *original = buf; for (i = 0; i < ntypes; i++) @@ -2032,10 +2030,7 @@ void ReadData::pairIJcoeffs() *next = '\0'; parse_coeffs(buf, nullptr, 0, 2, toffset, tlabelflag, lmap->lmap2lmap.atom); if (ncoeffarg == 0) - error->all(FLERR, - "Unexpected empty line in PairIJCoeffs section. " - "Expected {} lines.", - (ntypes - 1) * ntypes); + error->all(FLERR, "Unexpected empty line in PairIJCoeffs section. Expected {} lines.", nsq); force->pair->coeff(ncoeffarg, coeffarg); buf = next + 1; } @@ -2055,9 +2050,7 @@ void ReadData::bondcoeffs() if (eof) error->all(FLERR, "Unexpected end of data file"); if (blabelflag && !lmap->is_complete(Atom::BOND)) - error->all(FLERR, - "Label map is incomplete: " - "all types must be assigned a unique type label"); + error->all(FLERR, "Label map is incomplete: all types must be assigned a unique type label"); char *original = buf; for (int i = 0; i < nbondtypes; i++) { @@ -2086,9 +2079,7 @@ void ReadData::anglecoeffs(int which) if (eof) error->all(FLERR, "Unexpected end of data file"); if (alabelflag && !lmap->is_complete(Atom::ANGLE)) - error->all(FLERR, - "Label map is incomplete: " - "all types must be assigned a unique type label"); + error->all(FLERR, "Label map is incomplete: all types must be assigned a unique type label"); char *original = buf; for (int i = 0; i < nangletypes; i++) { @@ -2122,9 +2113,7 @@ void ReadData::dihedralcoeffs(int which) if (eof) error->all(FLERR, "Unexpected end of data file"); if (dlabelflag && !lmap->is_complete(Atom::DIHEDRAL)) - error->all(FLERR, - "Label map is incomplete: " - "all types must be assigned a unique type label"); + error->all(FLERR, "Label map is incomplete: all types must be assigned a unique type label"); char *original = buf; for (int i = 0; i < ndihedraltypes; i++) {