improved error messages for some more region commands

This commit is contained in:
vpalkar
2022-08-15 15:12:26 -04:00
parent c1f81eb640
commit 000c63a7ce
2 changed files with 8 additions and 6 deletions

View File

@ -27,9 +27,9 @@ RegIntersect::RegIntersect(LAMMPS *lmp, int narg, char **arg) :
{
nregion = 0;
if (narg < 5) error->all(FLERR, "Illegal region command");
if (narg < 5) error->all(FLERR, "Illegal region intersect {} arguments 5 expected");
int n = utils::inumeric(FLERR, arg[2], false, lmp);
if (n < 2) error->all(FLERR, "Illegal region command");
if (n < 2) error->all(FLERR, "Illegal region intersect n: {}", n);
options(narg - (n + 3), &arg[n + 3]);
// build list of regions to intersect