From 9beb60c71370182fb6004a7019c550fd919498d3 Mon Sep 17 00:00:00 2001 From: Jiancheng Chen <2742581175@qq.com> Date: Thu, 18 Aug 2022 11:22:36 +0800 Subject: [PATCH] improve error messages in change_box,create_box,domain,input,lattice and neighbor.cpp --- src/change_box.cpp | 35 ++++++++++++++--------------- src/create_box.cpp | 22 +++++++++--------- src/domain.cpp | 6 ++--- src/input.cpp | 8 +++---- src/lattice.cpp | 56 +++++++++++++++++++++++++--------------------- src/neighbor.cpp | 6 ++--- 6 files changed, 69 insertions(+), 64 deletions(-) diff --git a/src/change_box.cpp b/src/change_box.cpp index 08af5f11c9..b26d7803ed 100644 --- a/src/change_box.cpp +++ b/src/change_box.cpp @@ -46,14 +46,14 @@ void ChangeBox::command(int narg, char **arg) if (domain->box_exist == 0) error->all(FLERR,"Change_box command before simulation box is defined"); - if (narg < 2) error->all(FLERR,"Illegal change_box command"); + if (narg < 2) utils::missing_cmd_args(FLERR, "change_box", error); if (comm->me == 0) utils::logmesg(lmp,"Changing box ...\n"); // group int igroup = group->find(arg[0]); - if (igroup == -1) error->all(FLERR,"Could not find change_box group ID"); + if (igroup == -1) error->all(FLERR,"Could not find change_box group ID {}", arg[0]); int groupbit = group->bitmask[igroup]; // parse operation arguments @@ -70,7 +70,7 @@ void ChangeBox::command(int narg, char **arg) while (iarg < narg) { if (strcmp(arg[iarg],"x") == 0 || strcmp(arg[iarg],"y") == 0 || strcmp(arg[iarg],"z") == 0) { - if (iarg+2 > narg) error->all(FLERR,"Illegal change_box command"); + if (iarg+2 > narg) error->all(FLERR, "Illegal change_box {} command: missing argument(s)", arg[iarg]); ops[nops].style = XYZ; if (strcmp(arg[iarg],"x") == 0) ops[nops].dim = X; else if (strcmp(arg[iarg],"y") == 0) ops[nops].dim = Y; @@ -80,7 +80,7 @@ void ChangeBox::command(int narg, char **arg) error->all(FLERR,"Cannot change_box in z dimension for 2d simulation"); if (strcmp(arg[iarg+1],"final") == 0) { - if (iarg+4 > narg) error->all(FLERR,"Illegal change_box command"); + if (iarg+4 > narg) error->all(FLERR, "Illegal change_box {} final command: missing argument(s)", arg[iarg]); ops[nops].flavor = FINAL; ops[nops].flo = utils::numeric(FLERR,arg[iarg+2],false,lmp); ops[nops].fhi = utils::numeric(FLERR,arg[iarg+3],false,lmp); @@ -88,7 +88,7 @@ void ChangeBox::command(int narg, char **arg) nops++; iarg += 4; } else if (strcmp(arg[iarg+1],"delta") == 0) { - if (iarg+4 > narg) error->all(FLERR,"Illegal change_box command"); + if (iarg+4 > narg) error->all(FLERR, "Illegal change_box {} delta command: missing argument(s)", arg[iarg]); ops[nops].flavor = DELTA; ops[nops].dlo = utils::numeric(FLERR,arg[iarg+2],false,lmp); ops[nops].dhi = utils::numeric(FLERR,arg[iarg+3],false,lmp); @@ -96,7 +96,7 @@ void ChangeBox::command(int narg, char **arg) nops++; iarg += 4; } else if (strcmp(arg[iarg+1],"scale") == 0) { - if (iarg+3 > narg) error->all(FLERR,"Illegal change_box command"); + if (iarg+3 > narg) error->all(FLERR, "Illegal change_box {} scale command: missing argument(s)", arg[iarg]); ops[nops].flavor = SCALE; ops[nops].scale = utils::numeric(FLERR,arg[iarg+2],false,lmp); ops[nops].vdim1 = ops[nops].vdim2 = -1; @@ -112,11 +112,11 @@ void ChangeBox::command(int narg, char **arg) else ops[nops-1].vdim1 = ops[nops].dim; iarg += 2; - } else error->all(FLERR,"Illegal change_box command"); + } else error->all(FLERR, "Unknown change_box {} argument: {}", arg[iarg], arg[iarg+1]); } else if (strcmp(arg[iarg],"xy") == 0 || strcmp(arg[iarg],"xz") == 0 || strcmp(arg[iarg],"yz") == 0) { - if (iarg+2 > narg) error->all(FLERR,"Illegal change_box command"); + if (iarg+2 > narg) error->all(FLERR, "Illegal change_box {} command: missing argument(s)", arg[iarg]); ops[nops].style = TILT; if (strcmp(arg[iarg],"xy") == 0) ops[nops].dim = XY; else if (strcmp(arg[iarg],"xz") == 0) ops[nops].dim = XZ; @@ -126,21 +126,21 @@ void ChangeBox::command(int narg, char **arg) error->all(FLERR,"Cannot change_box in xz or yz for 2d simulation"); if (strcmp(arg[iarg+1],"final") == 0) { - if (iarg+3 > narg) error->all(FLERR,"Illegal change_box command"); + if (iarg+3 > narg) error->all(FLERR, "Illegal change_box {} final command: missing argument(s)", arg[iarg]); ops[nops].flavor = FINAL; ops[nops].ftilt = utils::numeric(FLERR,arg[iarg+2],false,lmp); nops++; iarg += 3; } else if (strcmp(arg[iarg+1],"delta") == 0) { - if (iarg+3 > narg) error->all(FLERR,"Illegal change_box command"); + if (iarg+3 > narg) error->all(FLERR, "Illegal change_box {} delta command: missing argument(s)", arg[iarg]); ops[nops].flavor = DELTA; ops[nops].dtilt = utils::numeric(FLERR,arg[iarg+2],false,lmp); nops++; iarg += 3; - } else error->all(FLERR,"Illegal change_box command"); + } else error->all(FLERR, "Unknown change_box {} argument: {}", arg[iarg], arg[iarg+1]); } else if (strcmp(arg[iarg],"boundary") == 0) { - if (iarg+4 > narg) error->all(FLERR,"Illegal change_box command"); + if (iarg+4 > narg) utils::missing_cmd_args(FLERR, "change_box boundary", error); ops[nops].style = BOUNDARY; ops[nops].boundindex = iarg+1; nops++; @@ -157,7 +157,6 @@ void ChangeBox::command(int narg, char **arg) iarg += 1; } else if (strcmp(arg[iarg],"set") == 0) { - if (iarg+1 > narg) error->all(FLERR,"Illegal change_box command"); ops[nops].style = SET; nops++; iarg += 1; @@ -170,7 +169,7 @@ void ChangeBox::command(int narg, char **arg) } else break; } - if (nops == 0) error->all(FLERR,"Illegal change_box command"); + if (nops == 0) error->all(FLERR, "Unknown change_box keyword: {}", arg[iarg]); // move_atoms = 1 if need to move atoms to new procs after box changes // anything other than ORTHO or TRICLINIC may cause atom movement @@ -393,19 +392,19 @@ void ChangeBox::command(int narg, char **arg) void ChangeBox::options(int narg, char **arg) { - if (narg < 0) error->all(FLERR,"Illegal change_box command"); + if (narg < 0) utils::missing_cmd_args(FLERR, "change_box", error); scaleflag = 1; int iarg = 0; while (iarg < narg) { if (strcmp(arg[iarg],"units") == 0) { - if (iarg+2 > narg) error->all(FLERR,"Illegal change_box command"); + if (iarg+2 > narg) utils::missing_cmd_args(FLERR, "change_box units", error); if (strcmp(arg[iarg+1],"box") == 0) scaleflag = 0; else if (strcmp(arg[iarg+1],"lattice") == 0) scaleflag = 1; - else error->all(FLERR,"Illegal change_box command"); + else error->all(FLERR, "Invalid change_box units argument: {}", arg[iarg+1]); iarg += 2; - } else error->all(FLERR,"Illegal change_box command"); + } else error->all(FLERR,"Unknown change_box keyword: {}", arg[iarg]); } } diff --git a/src/create_box.cpp b/src/create_box.cpp index cd6a63ca44..b05bfe0825 100644 --- a/src/create_box.cpp +++ b/src/create_box.cpp @@ -35,7 +35,7 @@ CreateBox::CreateBox(LAMMPS *lmp) : Command(lmp) {} void CreateBox::command(int narg, char **arg) { - if (narg < 2) error->all(FLERR, "Illegal create_box command"); + if (narg < 2) utils::missing_cmd_args(FLERR, "create_box", error); if (domain->box_exist) error->all(FLERR, "Cannot create_box after simulation box is defined"); if (domain->dimension == 2 && domain->zperiodic == 0) @@ -107,56 +107,56 @@ void CreateBox::command(int narg, char **arg) int iarg = 2; while (iarg < narg) { if (strcmp(arg[iarg], "bond/types") == 0) { - if (iarg + 2 > narg) error->all(FLERR, "Illegal create_box command"); + if (iarg + 2 > narg) utils::missing_cmd_args(FLERR, "create_box bond/type", error); if (!atom->avec->bonds_allow) error->all(FLERR, "No bonds allowed with this atom style"); atom->nbondtypes = utils::inumeric(FLERR, arg[iarg + 1], false, lmp); iarg += 2; } else if (strcmp(arg[iarg], "angle/types") == 0) { - if (iarg + 2 > narg) error->all(FLERR, "Illegal create_box command"); + if (iarg + 2 > narg) utils::missing_cmd_args(FLERR, "create_box angle/types", error); if (!atom->avec->angles_allow) error->all(FLERR, "No angles allowed with this atom style"); atom->nangletypes = utils::inumeric(FLERR, arg[iarg + 1], false, lmp); iarg += 2; } else if (strcmp(arg[iarg], "dihedral/types") == 0) { - if (iarg + 2 > narg) error->all(FLERR, "Illegal create_box command"); + if (iarg + 2 > narg) utils::missing_cmd_args(FLERR, "create_box dihedral/types", error); if (!atom->avec->dihedrals_allow) error->all(FLERR, "No dihedrals allowed with this atom style"); atom->ndihedraltypes = utils::inumeric(FLERR, arg[iarg + 1], false, lmp); iarg += 2; } else if (strcmp(arg[iarg], "improper/types") == 0) { - if (iarg + 2 > narg) error->all(FLERR, "Illegal create_box command"); + if (iarg + 2 > narg) utils::missing_cmd_args(FLERR, "create_box improper/types", error); if (!atom->avec->impropers_allow) error->all(FLERR, "No impropers allowed with this atom style"); atom->nimpropertypes = utils::inumeric(FLERR, arg[iarg + 1], false, lmp); iarg += 2; } else if (strcmp(arg[iarg], "extra/bond/per/atom") == 0) { - if (iarg + 2 > narg) error->all(FLERR, "Illegal create_box command"); + if (iarg + 2 > narg) utils::missing_cmd_args(FLERR, "create_box extra/bond/per/atom", error); if (!atom->avec->bonds_allow) error->all(FLERR, "No bonds allowed with this atom style"); atom->bond_per_atom = utils::inumeric(FLERR, arg[iarg + 1], false, lmp); iarg += 2; } else if (strcmp(arg[iarg], "extra/angle/per/atom") == 0) { - if (iarg + 2 > narg) error->all(FLERR, "Illegal create_box command"); + if (iarg + 2 > narg) utils::missing_cmd_args(FLERR, "create_box extra/angle/per/atom", error); if (!atom->avec->angles_allow) error->all(FLERR, "No angles allowed with this atom style"); atom->angle_per_atom = utils::inumeric(FLERR, arg[iarg + 1], false, lmp); iarg += 2; } else if (strcmp(arg[iarg], "extra/dihedral/per/atom") == 0) { - if (iarg + 2 > narg) error->all(FLERR, "Illegal create_box command"); + if (iarg + 2 > narg) utils::missing_cmd_args(FLERR, "create_box extra/dihedral/per/atom", error); if (!atom->avec->dihedrals_allow) error->all(FLERR, "No dihedrals allowed with this atom style"); atom->dihedral_per_atom = utils::inumeric(FLERR, arg[iarg + 1], false, lmp); iarg += 2; } else if (strcmp(arg[iarg], "extra/improper/per/atom") == 0) { - if (iarg + 2 > narg) error->all(FLERR, "Illegal create_box command"); + if (iarg + 2 > narg) utils::missing_cmd_args(FLERR, "create_box extra/improper/per/atom", error); if (!atom->avec->impropers_allow) error->all(FLERR, "No impropers allowed with this atom style"); atom->improper_per_atom = utils::inumeric(FLERR, arg[iarg + 1], false, lmp); iarg += 2; } else if (strcmp(arg[iarg], "extra/special/per/atom") == 0) { - if (iarg + 2 > narg) error->all(FLERR, "Illegal create_box command"); + if (iarg + 2 > narg) utils::missing_cmd_args(FLERR, "create_box extra/special/per/atom", error); force->special_extra = utils::inumeric(FLERR, arg[iarg + 1], false, lmp); atom->maxspecial += force->special_extra; iarg += 2; } else - error->all(FLERR, "Illegal create_box command"); + error->all(FLERR, "Unknown create_box keyword: {}", arg[iarg]); } // problem setup using info from header diff --git a/src/domain.cpp b/src/domain.cpp index ebc468faed..7d60c20a24 100644 --- a/src/domain.cpp +++ b/src/domain.cpp @@ -1856,7 +1856,7 @@ const std::vector Domain::get_region_list() void Domain::set_boundary(int narg, char **arg, int flag) { - if (narg != 3) error->all(FLERR,"Illegal boundary command"); + if (narg != 3) error->all(FLERR,"Illegal boundary command: expected 3 argument but found {}", narg); char c; for (int idim = 0; idim < 3; idim++) @@ -1870,8 +1870,8 @@ void Domain::set_boundary(int narg, char **arg, int flag) else if (c == 's') boundary[idim][iside] = 2; else if (c == 'm') boundary[idim][iside] = 3; else { - if (flag == 0) error->all(FLERR,"Illegal boundary command"); - if (flag == 1) error->all(FLERR,"Illegal change_box command"); + if (flag == 0) error->all(FLERR,"Unknown boundary keyword: {}", c); + if (flag == 1) error->all(FLERR,"Unknown change_box keyword: {}", c); } } diff --git a/src/input.cpp b/src/input.cpp index 2979503d30..bb84a86e2c 100644 --- a/src/input.cpp +++ b/src/input.cpp @@ -1351,7 +1351,7 @@ void Input::atom_modify() void Input::atom_style() { - if (narg < 1) error->all(FLERR,"Illegal atom_style command"); + if (narg < 1) utils::missing_cmd_args(FLERR, "atom_style", error); if (domain->box_exist) error->all(FLERR,"Atom_style command after simulation box is defined"); atom->create_avec(arg[0],narg-1,&arg[1],1); @@ -1488,12 +1488,12 @@ void Input::dihedral_style() void Input::dimension() { - if (narg != 1) error->all(FLERR,"Illegal dimension command"); + if (narg != 1) error->all(FLERR,"Illegal dimension command: expected 1 argument but found {}", narg); if (domain->box_exist) error->all(FLERR,"Dimension command after simulation box is defined"); domain->dimension = utils::inumeric(FLERR,arg[0],false,lmp); if (domain->dimension != 2 && domain->dimension != 3) - error->all(FLERR,"Illegal dimension command"); + error->all(FLERR, "Invalid dimension argument: {}", arg[0]); // must reset default extra_dof of all computes // since some were created before dimension command is encountered @@ -1948,7 +1948,7 @@ void Input::unfix() void Input::units() { - if (narg != 1) error->all(FLERR,"Illegal units command"); + if (narg != 1) error->all(FLERR,"Illegal units command: expected 1 argument but found {}", narg); if (domain->box_exist) error->all(FLERR,"Units command after simulation box is defined"); update->set_units(arg[0]); diff --git a/src/lattice.cpp b/src/lattice.cpp index be69fc1821..f88a55a4d5 100644 --- a/src/lattice.cpp +++ b/src/lattice.cpp @@ -36,7 +36,7 @@ Lattice::Lattice(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp) // parse style arg - if (narg < 1) error->all(FLERR,"Illegal lattice command"); + if (narg < 1) utils::missing_cmd_args(FLERR, "lattice", error); if (strcmp(arg[0],"none") == 0) style = NONE; else if (strcmp(arg[0],"sc") == 0) style = SC; @@ -48,10 +48,10 @@ Lattice::Lattice(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp) else if (strcmp(arg[0],"sq2") == 0) style = SQ2; else if (strcmp(arg[0],"hex") == 0) style = HEX; else if (strcmp(arg[0],"custom") == 0) style = CUSTOM; - else error->all(FLERR,"Illegal lattice command"); + else error->all(FLERR,"Unknown lattice keyword: {}", arg[0]); if (style == NONE) { - if (narg != 2) error->all(FLERR,"Illegal lattice command"); + if (narg != 2) error->all(FLERR,"Illegal lattice command: expected 2 argument but found {}", narg); // Domain creates a default lattice of style "none" // before Force class is instantiated, just use atof() in that case @@ -61,7 +61,7 @@ Lattice::Lattice(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp) else xlattice = ylattice = zlattice = atof(arg[1]); - if (xlattice <= 0.0) error->all(FLERR,"Illegal lattice command"); + if (xlattice <= 0.0) error->all(FLERR, "Invalid lattice none argument: {}", arg[1]); return; } @@ -81,9 +81,9 @@ Lattice::Lattice(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp) // scale = conversion factor between lattice and box units - if (narg < 2) error->all(FLERR,"Illegal lattice command"); + if (narg < 2) utils::missing_cmd_args(FLERR, "lattice", error); scale = utils::numeric(FLERR,arg[1],false,lmp); - if (scale <= 0.0) error->all(FLERR,"Illegal lattice command"); + if (scale <= 0.0) error->all(FLERR, "Invalid lattice {} argument: {}", arg[0], arg[1]); // set basis atoms for each style // x,y,z = fractional coords within unit cell @@ -148,23 +148,25 @@ Lattice::Lattice(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp) int iarg = 2; while (iarg < narg) { if (strcmp(arg[iarg],"origin") == 0) { - if (iarg+4 > narg) error->all(FLERR,"Illegal lattice command"); + if (iarg+4 > narg) utils::missing_cmd_args(FLERR, "lattice origin", error); origin[0] = utils::numeric(FLERR,arg[iarg+1],false,lmp); origin[1] = utils::numeric(FLERR,arg[iarg+2],false,lmp); origin[2] = utils::numeric(FLERR,arg[iarg+3],false,lmp); - if (origin[0] < 0.0 || origin[0] >= 1.0 || - origin[1] < 0.0 || origin[1] >= 1.0 || - origin[2] < 0.0 || origin[2] >= 1.0) - error->all(FLERR,"Illegal lattice command"); + if (origin[0] < 0.0 || origin[0] >= 1.0) + error->all(FLERR, "Invalid lattice origin argument: {}", origin[0]); + if (origin[1] < 0.0 || origin[1] >= 1.0) + error->all(FLERR, "Invalid lattice origin argument: {}", origin[1]); + if (origin[2] < 0.0 || origin[2] >= 1.0) + error->all(FLERR, "Invalid lattice origin argument: {}", origin[2]); iarg += 4; } else if (strcmp(arg[iarg],"orient") == 0) { - if (iarg+5 > narg) error->all(FLERR,"Illegal lattice command"); + if (iarg+5 > narg) utils::missing_cmd_args(FLERR, "lattice orient", error); int dim = -1; if (strcmp(arg[iarg+1],"x") == 0) dim = 0; else if (strcmp(arg[iarg+1],"y") == 0) dim = 1; else if (strcmp(arg[iarg+1],"z") == 0) dim = 2; - else error->all(FLERR,"Illegal lattice command"); + else error->all(FLERR,"Unknown lattice orient argument: {}", arg[iarg+1]); int *orient = nullptr; if (dim == 0) orient = orientx; else if (dim == 1) orient = orienty; @@ -175,7 +177,7 @@ Lattice::Lattice(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp) iarg += 5; } else if (strcmp(arg[iarg],"spacing") == 0) { - if (iarg+4 > narg) error->all(FLERR,"Illegal lattice command"); + if (iarg+4 > narg) utils::missing_cmd_args(FLERR, "lattice spacing", error); spaceflag = 1; xlattice = utils::numeric(FLERR,arg[iarg+1],false,lmp); ylattice = utils::numeric(FLERR,arg[iarg+2],false,lmp); @@ -183,46 +185,50 @@ Lattice::Lattice(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp) iarg += 4; } else if (strcmp(arg[iarg],"a1") == 0) { - if (iarg+4 > narg) error->all(FLERR,"Illegal lattice command"); + if (iarg+4 > narg) utils::missing_cmd_args(FLERR, "lattice a1", error); if (style != CUSTOM) error->all(FLERR, - "Invalid option in lattice command for non-custom style"); + "Invalid a1 in lattice command for non-custom style"); a1[0] = utils::numeric(FLERR,arg[iarg+1],false,lmp); a1[1] = utils::numeric(FLERR,arg[iarg+2],false,lmp); a1[2] = utils::numeric(FLERR,arg[iarg+3],false,lmp); iarg += 4; } else if (strcmp(arg[iarg],"a2") == 0) { - if (iarg+4 > narg) error->all(FLERR,"Illegal lattice command"); + if (iarg+4 > narg) utils::missing_cmd_args(FLERR, "lattice a2", error); if (style != CUSTOM) error->all(FLERR, - "Invalid option in lattice command for non-custom style"); + "Invalid a2 option in lattice command for non-custom style"); a2[0] = utils::numeric(FLERR,arg[iarg+1],false,lmp); a2[1] = utils::numeric(FLERR,arg[iarg+2],false,lmp); a2[2] = utils::numeric(FLERR,arg[iarg+3],false,lmp); iarg += 4; } else if (strcmp(arg[iarg],"a3") == 0) { - if (iarg+4 > narg) error->all(FLERR,"Illegal lattice command"); + if (iarg+4 > narg) utils::missing_cmd_args(FLERR, "lattice a3", error); if (style != CUSTOM) error->all(FLERR, - "Invalid option in lattice command for non-custom style"); + "Invalid a3 option in lattice command for non-custom style"); a3[0] = utils::numeric(FLERR,arg[iarg+1],false,lmp); a3[1] = utils::numeric(FLERR,arg[iarg+2],false,lmp); a3[2] = utils::numeric(FLERR,arg[iarg+3],false,lmp); iarg += 4; } else if (strcmp(arg[iarg],"basis") == 0) { - if (iarg+4 > narg) error->all(FLERR,"Illegal lattice command"); + if (iarg+4 > narg) utils::missing_cmd_args(FLERR, "lattice basis", error); if (style != CUSTOM) error->all(FLERR, - "Invalid option in lattice command for non-custom style"); + "Invalid basis option in lattice command for non-custom style"); double x = utils::numeric(FLERR,arg[iarg+1],false,lmp); double y = utils::numeric(FLERR,arg[iarg+2],false,lmp); double z = utils::numeric(FLERR,arg[iarg+3],false,lmp); - if (x < 0.0 || x >= 1.0 || y < 0.0 || y >= 1.0 || z < 0.0 || z >= 1.0) - error->all(FLERR,"Illegal lattice command"); + if (x < 0.0 || x >= 1.0) + error->all(FLERR, "Invalid lattice basis argument: {}", x); + if (y < 0.0 || y >= 1.0) + error->all(FLERR, "Invalid lattice basis argument: {}", y); + if (z < 0.0 || z >= 1.0) + error->all(FLERR, "Invalid lattice basis argument: {}", z); add_basis(x,y,z); iarg += 4; - } else error->all(FLERR,"Illegal lattice command"); + } else error->all(FLERR,"Unknown lattice keyword: {}", arg[iarg]); } // check settings for errors diff --git a/src/neighbor.cpp b/src/neighbor.cpp index 9e74ad3809..ab77e15a4b 100644 --- a/src/neighbor.cpp +++ b/src/neighbor.cpp @@ -2533,10 +2533,10 @@ void Neighbor::build_one(class NeighList *mylist, int preflag) void Neighbor::set(int narg, char **arg) { - if (narg != 2) error->all(FLERR,"Illegal neighbor command"); + if (narg != 2) error->all(FLERR,"Illegal neighbor command: expected 2 argument but found {}", narg); skin = utils::numeric(FLERR,arg[0],false,lmp); - if (skin < 0.0) error->all(FLERR,"Illegal neighbor command"); + if (skin < 0.0) error->all(FLERR, "Invalid neighbor argument: {}", arg[0]); if (strcmp(arg[1],"nsq") == 0) style = Neighbor::NSQ; else if (strcmp(arg[1],"bin") == 0) style = Neighbor::BIN; @@ -2544,7 +2544,7 @@ void Neighbor::set(int narg, char **arg) style = Neighbor::MULTI; ncollections = atom->ntypes; } else if (strcmp(arg[1],"multi/old") == 0) style = Neighbor::MULTI_OLD; - else error->all(FLERR,"Illegal neighbor command"); + else error->all(FLERR,"Unknown neighbor {} argument: {}", arg[0], arg[1]); if (style == Neighbor::MULTI_OLD && lmp->citeme) lmp->citeme->add(cite_neigh_multi_old); if (style == Neighbor::MULTI && lmp->citeme) lmp->citeme->add(cite_neigh_multi);