improved error messages in a bunch of region commands
This commit is contained in:
@ -80,8 +80,9 @@ RegBlock::RegBlock(LAMMPS *lmp, int narg, char **arg) : Region(lmp, narg, arg)
|
||||
|
||||
// error check
|
||||
|
||||
if (xlo > xhi || ylo > yhi || zlo > zhi)
|
||||
error->all(FLERR,"Illegal region block command");
|
||||
if (xlo > xhi) error->all(FLERR,"Illegal region block xlo: {} >= xhi: {}", xlo, xhi);
|
||||
if (ylo > yhi) error->all(FLERR,"Illegal region block ylo: {} >= yhi: {}", ylo, yhi);
|
||||
if (zlo > zhi) error->all(FLERR,"Illegal region block zlo: {} >= zhi: {}", zlo, zhi);
|
||||
|
||||
// extent of block
|
||||
|
||||
|
||||
@ -40,10 +40,10 @@ RegCylinder::RegCylinder(LAMMPS *lmp, int narg, char **arg) :
|
||||
if (openflag)
|
||||
for (int i=3; i<6; i++)
|
||||
if (open_faces[i])
|
||||
error->all(FLERR,"Illegal open face {} in region cylinder command", i);
|
||||
error->all(FLERR,"Illegal region cylinder open face: {}", i);
|
||||
|
||||
if (strcmp(arg[2],"x") != 0 && strcmp(arg[2],"y") != 0 && strcmp(arg[2],"z") != 0)
|
||||
error->all(FLERR,"Illegal axis {} in region cylinder command", arg[2]);
|
||||
error->all(FLERR,"Illegal region cylinder axis: {}", arg[2]);
|
||||
axis = arg[2][0];
|
||||
|
||||
if (axis == 'x') {
|
||||
|
||||
@ -101,7 +101,9 @@ RegEllipsoid::RegEllipsoid(LAMMPS *lmp, int narg, char **arg) :
|
||||
|
||||
// error check
|
||||
|
||||
if (a < 0.0 || b < 0.0 || c < 0.0) error->all(FLERR, "Illegal region ellipsoid command");
|
||||
if (a < 0.0) error->all(FLERR, "Illegal region ellipsoid a: {}", a);
|
||||
if (b < 0.0) error->all(FLERR, "Illegal region ellipsoid b: {}", b);
|
||||
if (c < 0.0) error->all(FLERR, "Illegal region ellipsoid c: {}", c);
|
||||
|
||||
// extent of ellipsoid
|
||||
// for variable axes, uses initial axes and origin for variable center
|
||||
|
||||
@ -37,7 +37,7 @@ RegPlane::RegPlane(LAMMPS *lmp, int narg, char **arg) :
|
||||
// enforce unit normal
|
||||
|
||||
double rsq = normal[0]*normal[0] + normal[1]*normal[1] + normal[2]*normal[2];
|
||||
if (rsq == 0.0) error->all(FLERR,"Illegal region plane command");
|
||||
if (rsq == 0.0) error->all(FLERR,"Illegal region plane normal vector: {} {} {}", normal[0], normal[1], normal[2]);
|
||||
normal[0] /= sqrt(rsq);
|
||||
normal[1] /= sqrt(rsq);
|
||||
normal[2] /= sqrt(rsq);
|
||||
|
||||
@ -84,23 +84,24 @@ RegPrism::RegPrism(LAMMPS *lmp, int narg, char **arg) : Region(lmp, narg, arg)
|
||||
// prism cannot be 0 thickness in any dim, else inverse blows up
|
||||
// non-zero tilt values cannot be used if either dim is INF on both ends
|
||||
|
||||
if (xlo >= xhi || ylo >= yhi || zlo >= zhi)
|
||||
error->all(FLERR,"Illegal region prism command");
|
||||
if (xlo >= xhi) error->all(FLERR,"Illegal region prism xlo: {} >= xhi: {}", xlo, xhi);
|
||||
if (ylo >= yhi) error->all(FLERR,"Illegal region prism ylo: {} >= yhi: {}", ylo, yhi);
|
||||
if (zlo >= zhi) error->all(FLERR,"Illegal region prism zlo: {} >= zhi: {}", zlo ,zhi);
|
||||
|
||||
if (xy != 0.0 && xlo == -BIG && xhi == BIG)
|
||||
error->all(FLERR,"Illegal region prism command");
|
||||
error->all(FLERR,"Illegal region prism non-zero xy tilt with infinite x size");
|
||||
if (xy != 0.0 && ylo == -BIG && yhi == BIG)
|
||||
error->all(FLERR,"Illegal region prism command");
|
||||
error->all(FLERR,"Illegal region prism non-zero xy tilt with infinite y size");
|
||||
|
||||
if (xz != 0.0 && xlo == -BIG && xhi == BIG)
|
||||
error->all(FLERR,"Illegal region prism command");
|
||||
error->all(FLERR,"Illegal region prism non-zero xz tilt with infinite x size");
|
||||
if (xz != 0.0 && zlo == -BIG && zhi == BIG)
|
||||
error->all(FLERR,"Illegal region prism command");
|
||||
error->all(FLERR,"Illegal region prism non-zero xz tilt with infinite z size");
|
||||
|
||||
if (yz != 0.0 && ylo == -BIG && yhi == BIG)
|
||||
error->all(FLERR,"Illegal region prism command");
|
||||
error->all(FLERR,"Illegal region prism non-zero yz tilt with infinite y size");
|
||||
if (yz != 0.0 && zlo == -BIG && zhi == BIG)
|
||||
error->all(FLERR,"Illegal region prism command");
|
||||
error->all(FLERR,"Illegal region prism non-zero yz tilt with infinite z size");
|
||||
|
||||
// extent of prism
|
||||
|
||||
|
||||
@ -79,7 +79,7 @@ RegSphere::RegSphere(LAMMPS *lmp, int narg, char **arg) :
|
||||
|
||||
// error check
|
||||
|
||||
if (radius < 0.0) error->all(FLERR,"Illegal region sphere command");
|
||||
if (radius < 0.0) error->all(FLERR,"Illegal region sphere radius: {}", radius);
|
||||
|
||||
// extent of sphere
|
||||
// for variable radius, uses initial radius and origin for variable center
|
||||
|
||||
@ -28,9 +28,9 @@ RegUnion::RegUnion(LAMMPS *lmp, int narg, char **arg) : Region(lmp, narg, arg),
|
||||
{
|
||||
nregion = 0;
|
||||
|
||||
if (narg < 5) error->all(FLERR, "Illegal region command");
|
||||
if (narg < 5) error->all(FLERR, "Illegal region union {} 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 union n: {}", n);
|
||||
options(narg - (n + 3), &arg[n + 3]);
|
||||
|
||||
// build list of region indices to union
|
||||
|
||||
Reference in New Issue
Block a user