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

@ -37,11 +37,13 @@ RegCone::RegCone(LAMMPS *lmp, int narg, char **arg) :
// check open face settings
if (openflag && (open_faces[3] || open_faces[4] || open_faces[5]))
error->all(FLERR,"Invalid region cone open setting");
if (openflag)
for (int i=3; i<6; i++)
if (open_faces[i])
error->all(FLERR,"Illegal region cone open face: {}", i);
if (strcmp(arg[2],"x") != 0 && strcmp(arg[2],"y") && strcmp(arg[2],"z") != 0)
error->all(FLERR,"Illegal region cylinder command");
if (strcmp(arg[2],"x") != 0 && strcmp(arg[2],"y") != 0 && strcmp(arg[2],"z") != 0)
error->all(FLERR,"Illegal region cone axis: {}", arg[2]);
axis = arg[2][0];
if (axis == 'x') {

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