improve error messages

This commit is contained in:
Axel Kohlmeyer
2023-04-03 21:49:43 -04:00
parent 27127a46cc
commit dfed9bf854
3 changed files with 26 additions and 29 deletions

View File

@ -515,44 +515,41 @@ void RegBlock::variable_check() // addition
{
if (xlostyle == VARIABLE) {
xlovar = input->variable->find(xlostr);
if (xlovar < 0) error->all(FLERR, "Variable name for region block does not exist");
if (xlovar < 0) error->all(FLERR, "Variable {} for region block does not exist", xlostr);
if (!input->variable->equalstyle(xlovar))
error->all(FLERR, "Variable for region block is invalid style");
error->all(FLERR, "Variable {} for region block is invalid style", xlostr);
}
if (xhistyle == VARIABLE) {
xhivar = input->variable->find(xhistr);
if (xhivar < 0) error->all(FLERR, "Variable name for region block does not exist");
if (xhivar < 0) error->all(FLERR, "Variable {} for region block does not exist", xhistr);
if (!input->variable->equalstyle(xhivar))
error->all(FLERR, "Variable for region block is invalid style");
error->all(FLERR, "Variable {} for region block is invalid style", xhistr);
}
if (ylostyle == VARIABLE) {
ylovar = input->variable->find(ylostr);
if (ylovar < 0) error->all(FLERR, "Variable name for region block does not exist");
if (ylovar < 0) error->all(FLERR, "Variable {} for region block does not exist", ylostr);
if (!input->variable->equalstyle(ylovar))
error->all(FLERR, "Variable for region block is invalid style");
error->all(FLERR, "Variable {} for region block is invalid style", ylostr);
}
if (yhistyle == VARIABLE) {
yhivar = input->variable->find(yhistr);
if (yhivar < 0) error->all(FLERR, "Variable name for region block does not exist");
if (yhivar < 0) error->all(FLERR, "Variable {} for region block does not exist", yhistr);
if (!input->variable->equalstyle(yhivar))
error->all(FLERR, "Variable for region block is invalid style");
error->all(FLERR, "Variable {} for region block is invalid style", yhistr);
}
if (zlostyle == VARIABLE) {
zlovar = input->variable->find(zlostr);
if (zlovar < 0) error->all(FLERR, "Variable name for region block does not exist");
if (zlovar < 0) error->all(FLERR, "Variable {} for region block does not exist", zlostr);
if (!input->variable->equalstyle(zlovar))
error->all(FLERR, "Variable for region block is invalid style");
error->all(FLERR, "Variable {} for region block is invalid style", zlostr);
}
if (zhistyle == VARIABLE) {
zhivar = input->variable->find(zhistr);
if (zhivar < 0) error->all(FLERR, "Variable name for region block does not exist");
if (zhivar < 0) error->all(FLERR, "Variable {} for region block does not exist", zhistr);
if (!input->variable->equalstyle(zhivar))
error->all(FLERR, "Variable for region block is invalid style");
error->all(FLERR, "Variable {} for region block is invalid style", zhistr);
}
}

View File

@ -793,23 +793,23 @@ void RegCylinder::variable_check()
{
if (c1style == VARIABLE) {
c1var = input->variable->find(c1str);
if (c1var < 0) error->all(FLERR, "Variable name for region cylinder does not exist");
if (c1var < 0) error->all(FLERR, "Variable {} for region cylinder does not exist", c1str);
if (!input->variable->equalstyle(c1var))
error->all(FLERR, "Variable for region cylinder is invalid style");
error->all(FLERR, "Variable {} for region cylinder is invalid style", c1str);
}
if (c2style == VARIABLE) {
c2var = input->variable->find(c2str);
if (c2var < 0) error->all(FLERR, "Variable name for region cylinder does not exist");
if (c2var < 0) error->all(FLERR, "Variable {} for region cylinder does not exist", c2str);
if (!input->variable->equalstyle(c2var))
error->all(FLERR, "Variable for region cylinder is invalid style");
error->all(FLERR, "Variable {} for region cylinder is invalid style", c2str);
}
if (rstyle == VARIABLE) {
rvar = input->variable->find(rstr);
if (rvar < 0) error->all(FLERR, "Variable name for region cylinder does not exist");
if (rvar < 0) error->all(FLERR, "Variable {} for region cylinder does not exist", rstr);
if (!input->variable->equalstyle(rvar))
error->all(FLERR, "Variable for region cylinder is invalid style");
error->all(FLERR, "Variable {} for region cylinder is invalid style", rstr);
}
}

View File

@ -217,30 +217,30 @@ void RegSphere::variable_check()
{
if (xstyle == VARIABLE) {
xvar = input->variable->find(xstr);
if (xvar < 0) error->all(FLERR, "Variable name for region sphere does not exist");
if (xvar < 0) error->all(FLERR, "Variable {} for region sphere does not exist", xstr);
if (!input->variable->equalstyle(xvar))
error->all(FLERR, "Variable for region sphere is invalid style");
error->all(FLERR, "Variable {} for region sphere is invalid style", xstr);
}
if (ystyle == VARIABLE) {
yvar = input->variable->find(ystr);
if (yvar < 0) error->all(FLERR, "Variable name for region sphere does not exist");
if (yvar < 0) error->all(FLERR, "Variable {} for region sphere does not exist", ystr);
if (!input->variable->equalstyle(yvar))
error->all(FLERR, "Variable for region sphere is invalid style");
error->all(FLERR, "Variable {} for region sphere is invalid style", ystr);
}
if (zstyle == VARIABLE) {
zvar = input->variable->find(zstr);
if (zvar < 0) error->all(FLERR, "Variable name for region sphere does not exist");
if (zvar < 0) error->all(FLERR, "Variable {} for region sphere does not exist", zstr);
if (!input->variable->equalstyle(zvar))
error->all(FLERR, "Variable for region sphere is invalid style");
error->all(FLERR, "Variable {} for region sphere is invalid style", zstr);
}
if (rstyle == VARIABLE) {
rvar = input->variable->find(rstr);
if (rvar < 0) error->all(FLERR, "Variable name for region sphere does not exist");
if (rvar < 0) error->all(FLERR, "Variable {} for region sphere does not exist", rstr);
if (!input->variable->equalstyle(rvar))
error->all(FLERR, "Variable for region sphere is invalid style");
error->all(FLERR, "Variable {} for region sphere is invalid style", rstr);
}
}