diff --git a/doc/src/Errors_details.rst b/doc/src/Errors_details.rst index a5b0d1b100..ae731a316b 100644 --- a/doc/src/Errors_details.rst +++ b/doc/src/Errors_details.rst @@ -912,3 +912,29 @@ typically happens when there are multiple fix commands that advance atom positions with overlapping groups. Also, for some fix styles it is not immediately obvious that they include time integration. Please check the documentation carefully. + +.. _err0033: + +XXX command before simulation box is defined +-------------------------------------------- + +This error happens, when trying to excute a LAMMPS command that requires +information about the system dimensions, or the number atom, bond, +angle, dihedral, or improper types, or the number of atoms or similar +data that is only available *after* the simulation box has been created. +See the paragraph on :ref:`errors before or after the simulation box is +created ` for additional information. + +.. _err0034: + +XXX command after simulation box is defined +-------------------------------------------- + +This error happens, when trying to excute a LAMMPS command that that +changes a global setting that will be locked in when the simulation box +is created (for instance defining the :doc:`atom style `, +:doc:`dimension `, :doc:`newton `, or :doc:`units +` setting). These settings may only be changed *before* the +simulation box has been created. See the paragraph on :ref:`errors +before or after the simulation box is created ` for additional +information. diff --git a/src/DIELECTRIC/pppm_dielectric.cpp b/src/DIELECTRIC/pppm_dielectric.cpp index 0a24c44bd6..e5b0c5abb1 100644 --- a/src/DIELECTRIC/pppm_dielectric.cpp +++ b/src/DIELECTRIC/pppm_dielectric.cpp @@ -306,10 +306,10 @@ void PPPMDielectric::qsum_qsq(int warning_flag) // so issue warning or error if (fabs(qsum) > SMALL) { - std::string message = fmt::format("System is not charge neutral, net " - "charge = {:.8}",qsum); - if (!warn_nonneutral) error->all(FLERR,message + utils::errorurl(29)); - if (warn_nonneutral == 1 && comm->me == 0) error->warning(FLERR,message + utils::errorurl(29)); + std::string message = fmt::format("System is not charge neutral, net charge = {:.8}{}", + qsum, utils::errorurl(29)); + if (!warn_nonneutral) error->all(FLERR,message); + if (warn_nonneutral == 1 && comm->me == 0) error->warning(FLERR,message); warn_nonneutral = 2; } } diff --git a/src/DIELECTRIC/pppm_disp_dielectric.cpp b/src/DIELECTRIC/pppm_disp_dielectric.cpp index 252a9386e3..052b617351 100644 --- a/src/DIELECTRIC/pppm_disp_dielectric.cpp +++ b/src/DIELECTRIC/pppm_disp_dielectric.cpp @@ -580,10 +580,10 @@ void PPPMDispDielectric::qsum_qsq(int warning_flag) // so issue warning or error if (fabs(qsum) > SMALL) { - std::string message = fmt::format("System is not charge neutral, net " - "charge = {:.8}",qsum); - if (!warn_nonneutral) error->all(FLERR,message + utils::errorurl(29)); - if (warn_nonneutral == 1 && comm->me == 0) error->warning(FLERR,message + utils::errorurl(29)); + std::string message = fmt::format("System is not charge neutral, net charge = {:.8}{}", + qsum, utils::errorurl(29)); + if (!warn_nonneutral) error->all(FLERR,message); + if (warn_nonneutral == 1 && comm->me == 0) error->warning(FLERR,message); warn_nonneutral = 2; } } diff --git a/src/KIM/kim_init.cpp b/src/KIM/kim_init.cpp index f7dd01be49..48b4d2eec2 100644 --- a/src/KIM/kim_init.cpp +++ b/src/KIM/kim_init.cpp @@ -86,7 +86,7 @@ void KimInit::command(int narg, char **arg) if ((narg < 2) || (narg > 3)) error->all(FLERR, "Illegal 'kim init' command"); if (domain->box_exist) - error->all(FLERR, "Must use 'kim init' command before simulation box is defined"); + error->all(FLERR, "Must use 'kim init' command before simulation box is defined" + utils::errorurl(33)); char *model_name = utils::strdup(arg[0]); char *user_units = utils::strdup(arg[1]); diff --git a/src/PHONON/dynamical_matrix.cpp b/src/PHONON/dynamical_matrix.cpp index a0199747c4..bdcf9c36f3 100644 --- a/src/PHONON/dynamical_matrix.cpp +++ b/src/PHONON/dynamical_matrix.cpp @@ -112,7 +112,7 @@ void DynamicalMatrix::command(int narg, char **arg) MPI_Comm_rank(world,&me); if (domain->box_exist == 0) - error->all(FLERR,"Dynamical_matrix command before simulation box is defined"); + error->all(FLERR,"Dynamical_matrix command before simulation box is defined" + utils::errorurl(33)); if (narg < 2) error->all(FLERR,"Illegal dynamical_matrix command"); lmp->init(); diff --git a/src/PHONON/third_order.cpp b/src/PHONON/third_order.cpp index 378905bd29..e1d9161ef1 100644 --- a/src/PHONON/third_order.cpp +++ b/src/PHONON/third_order.cpp @@ -118,7 +118,7 @@ void ThirdOrder::command(int narg, char **arg) MPI_Comm_rank(world,&me); if (domain->box_exist == 0) - error->all(FLERR,"third_order command before simulation box is defined"); + error->all(FLERR,"third_order command before simulation box is defined" + utils::errorurl(33)); if (narg < 2) error->all(FLERR,"Illegal third_order command"); // request a full neighbor list for use by this command diff --git a/src/QEQ/fix_qeq.cpp b/src/QEQ/fix_qeq.cpp index bbfb4d8a0b..8c54dc96cb 100644 --- a/src/QEQ/fix_qeq.cpp +++ b/src/QEQ/fix_qeq.cpp @@ -336,7 +336,8 @@ void FixQEq::init() MPI_Allreduce(&qsum_local,&qsum,1,MPI_DOUBLE,MPI_SUM,world); if ((comm->me == 0) && (fabs(qsum) > QSUMSMALL)) - error->warning(FLERR,"Fix {} group is not charge neutral, net charge = {:.8}", style, qsum); + error->warning(FLERR,"Fix {} group is not charge neutral, net charge = {:.8}{}", + style, qsum, utils::errorurl(29)); } /* ---------------------------------------------------------------------- */ diff --git a/src/REPLICA/hyper.cpp b/src/REPLICA/hyper.cpp index 2c7d13766f..df853642b4 100644 --- a/src/REPLICA/hyper.cpp +++ b/src/REPLICA/hyper.cpp @@ -52,7 +52,7 @@ void Hyper::command(int narg, char **arg) // error checks if (domain->box_exist == 0) - error->all(FLERR,"Hyper command before simulation box is defined"); + error->all(FLERR,"Hyper command before simulation box is defined" + utils::errorurl(33)); if (narg < 4) error->all(FLERR,"Illegal hyper command"); diff --git a/src/REPLICA/neb.cpp b/src/REPLICA/neb.cpp index 4b242965c8..a65fc9a58f 100644 --- a/src/REPLICA/neb.cpp +++ b/src/REPLICA/neb.cpp @@ -113,7 +113,7 @@ NEB::~NEB() void NEB::command(int narg, char **arg) { if (domain->box_exist == 0) - error->universe_all(FLERR, "NEB command before simulation box is defined"); + error->universe_all(FLERR, "NEB command before simulation box is defined" + utils::errorurl(33)); if (narg < 6) error->universe_all(FLERR, "Illegal NEB command: missing argument(s)"); diff --git a/src/REPLICA/prd.cpp b/src/REPLICA/prd.cpp index 91150d8a38..493fb4da54 100644 --- a/src/REPLICA/prd.cpp +++ b/src/REPLICA/prd.cpp @@ -60,7 +60,7 @@ void PRD::command(int narg, char **arg) // error checks if (domain->box_exist == 0) - error->all(FLERR,"PRD command before simulation box is defined"); + error->all(FLERR,"PRD command before simulation box is defined" + utils::errorurl(33)); if (universe->nworlds != universe->nprocs && atom->map_style == Atom::MAP_NONE) error->all(FLERR,"Cannot use PRD with multi-processor replicas " diff --git a/src/REPLICA/tad.cpp b/src/REPLICA/tad.cpp index 38ddfceb84..14f816b15e 100644 --- a/src/REPLICA/tad.cpp +++ b/src/REPLICA/tad.cpp @@ -74,7 +74,7 @@ void TAD::command(int narg, char **arg) // error checks if (domain->box_exist == 0) - error->all(FLERR,"Tad command before simulation box is defined"); + error->all(FLERR,"Tad command before simulation box is defined" + utils::errorurl(33)); if (universe->nworlds == 1) error->all(FLERR,"Cannot use TAD with a single replica for NEB"); if (universe->nworlds != universe->nprocs) diff --git a/src/REPLICA/temper.cpp b/src/REPLICA/temper.cpp index 77bc45e6e3..a7416418be 100644 --- a/src/REPLICA/temper.cpp +++ b/src/REPLICA/temper.cpp @@ -64,7 +64,7 @@ void Temper::command(int narg, char **arg) if (universe->nworlds == 1) error->universe_all(FLERR,"More than one processor partition required for temper command"); if (domain->box_exist == 0) - error->universe_all(FLERR,"Temper command before simulation box is defined"); + error->universe_all(FLERR,"Temper command before simulation box is defined" + utils::errorurl(33)); if (narg != 6 && narg != 7) error->universe_all(FLERR,"Illegal temper command"); int nsteps = utils::inumeric(FLERR,arg[0],false,lmp); diff --git a/src/REPLICA/temper_grem.cpp b/src/REPLICA/temper_grem.cpp index c4509791c3..9ef0fe8a4a 100644 --- a/src/REPLICA/temper_grem.cpp +++ b/src/REPLICA/temper_grem.cpp @@ -66,7 +66,7 @@ void TemperGrem::command(int narg, char **arg) if (universe->nworlds == 1) error->universe_all(FLERR,"More than one processor partition required for temper/grem command"); if (domain->box_exist == 0) - error->universe_all(FLERR,"Temper/grem command before simulation box is defined"); + error->universe_all(FLERR,"Temper/grem command before simulation box is defined" + utils::errorurl(33)); if (narg != 7 && narg != 8) error->universe_all(FLERR,"Illegal temper/grem command"); int nsteps = utils::inumeric(FLERR,arg[0],false,lmp); diff --git a/src/REPLICA/temper_npt.cpp b/src/REPLICA/temper_npt.cpp index aa72047fe7..4c04ecfe7b 100644 --- a/src/REPLICA/temper_npt.cpp +++ b/src/REPLICA/temper_npt.cpp @@ -66,7 +66,7 @@ void TemperNPT::command(int narg, char **arg) if (universe->nworlds == 1) error->universe_all(FLERR,"More than one processor partition required for temper/npt command"); if (domain->box_exist == 0) - error->universe_all(FLERR,"Temper/npt command before simulation box is defined"); + error->universe_all(FLERR,"Temper/npt command before simulation box is defined" + utils::errorurl(33)); if (narg != 7 && narg != 8) error->universe_all(FLERR,"Illegal temper/npt command"); int nsteps = utils::inumeric(FLERR,arg[0],false,lmp); diff --git a/src/SPIN/neb_spin.cpp b/src/SPIN/neb_spin.cpp index 00b92b906a..34d5a37b17 100644 --- a/src/SPIN/neb_spin.cpp +++ b/src/SPIN/neb_spin.cpp @@ -95,7 +95,7 @@ NEBSpin::~NEBSpin() void NEBSpin::command(int narg, char **arg) { if (domain->box_exist == 0) - error->all(FLERR,"NEBSpin command before simulation box is defined"); + error->all(FLERR,"NEBSpin command before simulation box is defined" + utils::errorurl(33)); if (narg < 6) error->universe_all(FLERR,"Illegal NEBSpin command"); diff --git a/src/angle_write.cpp b/src/angle_write.cpp index 1c1601d002..4a328a9c98 100644 --- a/src/angle_write.cpp +++ b/src/angle_write.cpp @@ -43,11 +43,11 @@ void AngleWrite::command(int narg, char **arg) // sanity checks if (domain->box_exist == 0) - error->all(FLERR, "Angle_write command before simulation box is defined"); + error->all(FLERR, "Angle_write command before simulation box is defined" + utils::errorurl(33)); if (atom->avec->angles_allow == 0) error->all(FLERR, "Angle_write command when no angles allowed"); auto angle = force->angle; - if (angle == nullptr) error->all(FLERR, "Angle_write command before an angle_style is defined"); + if (angle == nullptr) error->all(FLERR, "Angle_write command before an angle_style is defined" + utils::errorurl(33)); if (angle && (force->angle->writedata == 0)) error->all(FLERR, "Angle style must support writing coeffs to data file for angle_write"); diff --git a/src/atom.cpp b/src/atom.cpp index bbc00dec75..3a95d65371 100644 --- a/src/atom.cpp +++ b/src/atom.cpp @@ -836,13 +836,15 @@ void Atom::modify_params(int narg, char **arg) if (strcmp(arg[iarg],"id") == 0) { if (iarg+2 > narg) utils::missing_cmd_args(FLERR, "atom_modify id", error); if (domain->box_exist) - error->all(FLERR, idx, "Atom_modify id command after simulation box is defined"); + error->all(FLERR, idx, "Atom_modify id command after simulation box is defined" + + utils::errorurl(34)); tag_enable = utils::logical(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"map") == 0) { if (iarg+2 > narg) utils::missing_cmd_args(FLERR, "atom_modify map", error); if (domain->box_exist) - error->all(FLERR, idx, "Atom_modify map command after simulation box is defined"); + error->all(FLERR, idx, "Atom_modify map command after simulation box is defined" + + utils::errorurl(34)); if (strcmp(arg[iarg+1],"array") == 0) map_user = MAP_ARRAY; else if (strcmp(arg[iarg+1],"hash") == 0) map_user = MAP_HASH; else if (strcmp(arg[iarg+1],"yes") == 0) map_user = MAP_YES; diff --git a/src/balance.cpp b/src/balance.cpp index 5ebe242bfb..22a0938b3c 100644 --- a/src/balance.cpp +++ b/src/balance.cpp @@ -113,7 +113,7 @@ Balance::~Balance() void Balance::command(int narg, char **arg) { if (domain->box_exist == 0) - error->all(FLERR, -1, "Balance command before simulation box is defined"); + error->all(FLERR, -1, "Balance command before simulation box is defined" + utils::errorurl(33)); if (comm->me == 0) utils::logmesg(lmp,"Balancing ...\n"); diff --git a/src/change_box.cpp b/src/change_box.cpp index 5223218f3d..e6b7b5cdc4 100644 --- a/src/change_box.cpp +++ b/src/change_box.cpp @@ -45,7 +45,7 @@ void ChangeBox::command(int narg, char **arg) int i; if (domain->box_exist == 0) - error->all(FLERR,"Change_box command before simulation box is defined"); + error->all(FLERR,"Change_box command before simulation box is defined" + utils::errorurl(33)); if (narg < 2) utils::missing_cmd_args(FLERR, "change_box", error); if (comm->me == 0) utils::logmesg(lmp,"Changing box ...\n"); diff --git a/src/create_atoms.cpp b/src/create_atoms.cpp index dc00e2e1d1..7be67f4c49 100644 --- a/src/create_atoms.cpp +++ b/src/create_atoms.cpp @@ -73,7 +73,7 @@ CreateAtoms::CreateAtoms(LAMMPS *lmp) : Command(lmp), basistype(nullptr) {} void CreateAtoms::command(int narg, char **arg) { if (domain->box_exist == 0) - error->all(FLERR, "Create_atoms command before simulation box is defined"); + error->all(FLERR, "Create_atoms command before simulation box is defined" + utils::errorurl(33)); if (modify->nfix_restart_peratom) error->all(FLERR, "Cannot create_atoms after reading restart file with per-atom info"); diff --git a/src/create_bonds.cpp b/src/create_bonds.cpp index 416884138b..28d6f4c136 100644 --- a/src/create_bonds.cpp +++ b/src/create_bonds.cpp @@ -44,7 +44,7 @@ CreateBonds::CreateBonds(LAMMPS *lmp) : Command(lmp) {} void CreateBonds::command(int narg, char **arg) { if (domain->box_exist == 0) - error->all(FLERR, "Create_bonds command before simulation box is defined"); + error->all(FLERR, "Create_bonds command before simulation box is defined" + utils::errorurl(33)); if (atom->tag_enable == 0) error->all(FLERR, "Cannot use create_bonds unless atoms have IDs"); if (atom->molecular != Atom::MOLECULAR) error->all(FLERR, "Cannot use create_bonds with non-molecular system"); diff --git a/src/create_box.cpp b/src/create_box.cpp index 93e699e06b..52d56a4ea1 100644 --- a/src/create_box.cpp +++ b/src/create_box.cpp @@ -38,7 +38,8 @@ void CreateBox::command(int narg, char **arg) { 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->box_exist) + error->all(FLERR, "Cannot create_box after simulation box is defined" + utils::errorurl(34)); if (domain->dimension == 2 && domain->zperiodic == 0) error->all(FLERR, "Cannot run 2d simulation with nonperiodic Z dimension"); diff --git a/src/delete_atoms.cpp b/src/delete_atoms.cpp index 35f608461b..96639ae85e 100644 --- a/src/delete_atoms.cpp +++ b/src/delete_atoms.cpp @@ -52,7 +52,7 @@ DeleteAtoms::DeleteAtoms(LAMMPS *lmp) : Command(lmp) {} void DeleteAtoms::command(int narg, char **arg) { if (domain->box_exist == 0) - error->all(FLERR, "Delete_atoms command before simulation box is defined"); + error->all(FLERR, "Delete_atoms command before simulation box is defined" + utils::errorurl(33)); if (narg < 1) utils::missing_cmd_args(FLERR, "delete_atoms", error); if (atom->tag_enable == 0) error->all(FLERR, "Cannot use delete_atoms unless atoms have IDs"); diff --git a/src/delete_bonds.cpp b/src/delete_bonds.cpp index 056851bec1..95928138eb 100644 --- a/src/delete_bonds.cpp +++ b/src/delete_bonds.cpp @@ -40,7 +40,7 @@ DeleteBonds::DeleteBonds(LAMMPS *lmp) : Command(lmp) {} void DeleteBonds::command(int narg, char **arg) { if (domain->box_exist == 0) - error->all(FLERR,"Delete_bonds command before simulation box is defined"); + error->all(FLERR,"Delete_bonds command before simulation box is defined" + utils::errorurl(33)); if (atom->natoms == 0) error->all(FLERR,"Delete_bonds command with no atoms existing"); if (atom->molecular != Atom::MOLECULAR) diff --git a/src/dihedral_write.cpp b/src/dihedral_write.cpp index 11d283dc27..24cae8db3b 100644 --- a/src/dihedral_write.cpp +++ b/src/dihedral_write.cpp @@ -42,12 +42,12 @@ void DihedralWrite::command(int narg, char **arg) // sanity checks if (domain->box_exist == 0) - error->all(FLERR, "Dihedral_write command before simulation box is defined"); + error->all(FLERR, "Dihedral_write command before simulation box is defined" + utils::errorurl(33)); if (atom->avec->dihedrals_allow == 0) error->all(FLERR, "Dihedral_write command when no dihedrals allowed"); auto dihedral = force->dihedral; if (dihedral == nullptr) - error->all(FLERR, "Dihedral_write command before an dihedral_style is defined"); + error->all(FLERR, "Dihedral_write command before an dihedral_style is defined" + utils::errorurl(33)); if (dihedral && (force->dihedral->writedata == 0)) error->all(FLERR, "Dihedral style must support writing coeffs to data file for dihedral_write"); diff --git a/src/displace_atoms.cpp b/src/displace_atoms.cpp index f930fa0980..b50090143b 100644 --- a/src/displace_atoms.cpp +++ b/src/displace_atoms.cpp @@ -63,7 +63,7 @@ void DisplaceAtoms::command(int narg, char **arg) int i; if (domain->box_exist == 0) - error->all(FLERR,"Displace_atoms command before simulation box is defined"); + error->all(FLERR,"Displace_atoms command before simulation box is defined" + utils::errorurl(33)); if (narg < 2) error->all(FLERR,"Illegal displace_atoms command"); if (modify->nfix_restart_peratom) error->all(FLERR,"Cannot displace_atoms after " diff --git a/src/group.cpp b/src/group.cpp index 136faa4059..0b4ea743cf 100644 --- a/src/group.cpp +++ b/src/group.cpp @@ -92,7 +92,7 @@ void Group::assign(int narg, char **arg) { int i; - if (domain->box_exist == 0) error->all(FLERR, "Group command before simulation box is defined"); + if (domain->box_exist == 0) error->all(FLERR, "Group command before simulation box is defined" + utils::errorurl(33)); if (narg < 2) utils::missing_cmd_args(FLERR, "group", error); // delete the group if not being used elsewhere diff --git a/src/input.cpp b/src/input.cpp index 6ea710f567..bc9a55052c 100644 --- a/src/input.cpp +++ b/src/input.cpp @@ -1347,7 +1347,7 @@ void Input::variable_command() void Input::angle_coeff() { if (domain->box_exist == 0) - error->all(FLERR,"Angle_coeff command before simulation box is defined"); + error->all(FLERR,"Angle_coeff command before simulation box is defined" + utils::errorurl(33)); if (force->angle == nullptr) error->all(FLERR,"Angle_coeff command before angle_style is defined"); if (atom->avec->angles_allow == 0) @@ -1382,7 +1382,7 @@ void Input::atom_style() { 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"); + error->all(FLERR,"Atom_style command after simulation box is defined" + utils::errorurl(34)); atom->create_avec(arg[0],narg-1,&arg[1],1); } @@ -1391,7 +1391,7 @@ void Input::atom_style() void Input::bond_coeff() { if (domain->box_exist == 0) - error->all(FLERR,"Bond_coeff command before simulation box is defined"); + error->all(FLERR,"Bond_coeff command before simulation box is defined" + utils::errorurl(33)); if (force->bond == nullptr) error->all(FLERR,"Bond_coeff command before bond_style is defined"); if (atom->avec->bonds_allow == 0) @@ -1429,7 +1429,7 @@ void Input::bond_write() void Input::boundary() { if (domain->box_exist) - error->all(FLERR,"Boundary command after simulation box is defined"); + error->all(FLERR,"Boundary command after simulation box is defined" + utils::errorurl(34)); domain->set_boundary(narg,arg,0); } @@ -1486,7 +1486,8 @@ void Input::dielectric() void Input::dihedral_coeff() { if (domain->box_exist == 0) - error->all(FLERR,"Dihedral_coeff command before simulation box is defined"); + error->all(FLERR,"Dihedral_coeff command before simulation box is defined" + + utils::errorurl(33)); if (force->dihedral == nullptr) error->all(FLERR,"Dihedral_coeff command before dihedral_style is defined"); if (atom->avec->dihedrals_allow == 0) @@ -1514,7 +1515,7 @@ void Input::dimension() { if (narg != 1) error->all(FLERR, "Dimension command expects exactly 1 argument"); if (domain->box_exist) - error->all(FLERR,"Dimension command after simulation box is defined"); + error->all(FLERR,"Dimension command after simulation box is defined" + utils::errorurl(34)); domain->dimension = utils::inumeric(FLERR,arg[0],false,lmp); if (domain->dimension != 2 && domain->dimension != 3) error->all(FLERR, "Invalid dimension argument: {}", arg[0]); @@ -1565,7 +1566,7 @@ void Input::group_command() void Input::improper_coeff() { if (domain->box_exist == 0) - error->all(FLERR,"Improper_coeff command before simulation box is defined"); + error->all(FLERR,"Improper_coeff command before simulation box is defined" + utils::errorurl(33)); if (force->improper == nullptr) error->all(FLERR,"Improper_coeff command before improper_style is defined"); if (atom->avec->impropers_allow == 0) @@ -1607,7 +1608,8 @@ void Input::kspace_style() void Input::labelmap() { - if (domain->box_exist == 0) error->all(FLERR,"Labelmap command before simulation box is defined"); + if (domain->box_exist == 0) + error->all(FLERR,"Labelmap command before simulation box is defined" + utils::errorurl(33)); if (!atom->labelmapflag) atom->add_label_map(); atom->lmap->modify_lmap(narg,arg); } @@ -1625,7 +1627,7 @@ void Input::mass() { if (narg != 2) error->all(FLERR,"Illegal mass command: expected 2 arguments but found {}", narg); if (domain->box_exist == 0) - error->all(FLERR,"Mass command before simulation box is defined"); + error->all(FLERR,"Mass command before simulation box is defined" + utils::errorurl(33)); atom->set_mass(FLERR,narg,arg); } @@ -1641,7 +1643,7 @@ void Input::min_modify() void Input::min_style() { if (domain->box_exist == 0) - error->all(FLERR,"Min_style command before simulation box is defined"); + error->all(FLERR,"Min_style command before simulation box is defined" + utils::errorurl(33)); update->create_minimize(narg,arg,1); } @@ -1682,7 +1684,7 @@ void Input::newton() force->newton_pair = newton_pair; if (domain->box_exist && (newton_bond != force->newton_bond)) - error->all(FLERR,"Newton bond change after simulation box is defined"); + error->all(FLERR,"Newton bond change after simulation box is defined" + utils::errorurl(34)); force->newton_bond = newton_bond; if (newton_pair || newton_bond) force->newton = 1; @@ -1696,8 +1698,8 @@ void Input::newton() void Input::package() { if (domain->box_exist) - error->all(FLERR,"Package command after simulation box is defined"); - if (narg < 1) error->all(FLERR,"Illegal package command"); + error->all(FLERR,"Package command after simulation box is defined" + utils::errorurl(34)); + if (narg < 1) utils::missing_cmd_args(FLERR, "package", error); // same checks for packages existing as in LAMMPS::post_create() // since can be invoked here by package command in input script @@ -1739,7 +1741,7 @@ void Input::package() void Input::pair_coeff() { if (domain->box_exist == 0) - error->all(FLERR,"Pair_coeff command before simulation box is defined"); + error->all(FLERR,"Pair_coeff command before simulation box is defined" + utils::errorurl(33)); if (force->pair == nullptr) error->all(FLERR,"Pair_coeff command without a pair style"); if (narg < 2) utils::missing_cmd_args(FLERR,"pair_coeff", error); if (force->pair->one_coeff && ((strcmp(arg[0],"*") != 0) || (strcmp(arg[1],"*") != 0))) @@ -1820,7 +1822,7 @@ void Input::pair_write() void Input::processors() { if (domain->box_exist) - error->all(FLERR,"Processors command after simulation box is defined"); + error->all(FLERR,"Processors command after simulation box is defined" + utils::errorurl(34)); comm->set_processors(narg,arg); } @@ -1850,7 +1852,7 @@ void Input::restart() void Input::run_style() { if (domain->box_exist == 0) - error->all(FLERR,"Run_style command before simulation box is defined"); + error->all(FLERR,"Run_style command before simulation box is defined" + utils::errorurl(33)); update->create_integrate(narg,arg,1); } @@ -2002,7 +2004,7 @@ void Input::units() { 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"); + error->all(FLERR,"Units command after simulation box is defined" + utils::errorurl(34)); update->set_units(arg[0]); } diff --git a/src/kspace.cpp b/src/kspace.cpp index bf5fdf8378..2de25d6e86 100644 --- a/src/kspace.cpp +++ b/src/kspace.cpp @@ -321,10 +321,10 @@ void KSpace::qsum_qsq(int warning_flag) // so issue warning or error if (fabs(qsum) > SMALL) { - std::string message = fmt::format("System is not charge neutral, net " - "charge = {:.8}",qsum); - if (!warn_nonneutral) error->all(FLERR,message + utils::errorurl(29)); - if (warn_nonneutral == 1 && comm->me == 0) error->warning(FLERR,message + utils::errorurl(29)); + std::string message = fmt::format("System is not charge neutral, net charge = {:.8}{}", + qsum, utils::errorurl(29)); + if (!warn_nonneutral) error->all(FLERR,message); + if (warn_nonneutral == 1 && comm->me == 0) error->warning(FLERR,message); warn_nonneutral = 2; } } diff --git a/src/label_map.cpp b/src/label_map.cpp index 24cef51062..82d1eaac02 100644 --- a/src/label_map.cpp +++ b/src/label_map.cpp @@ -254,7 +254,7 @@ int LabelMap::find_or_create(const std::string &mylabel, std::vectorall(FLERR, "Topology type exceeds system topology type"); + error->all(FLERR, "Topology type exceeds system topology type" + utils::errorurl(25)); // never reaches here, just to prevent compiler warning diff --git a/src/minimize.cpp b/src/minimize.cpp index d13429804c..8fd90ade5f 100644 --- a/src/minimize.cpp +++ b/src/minimize.cpp @@ -35,7 +35,7 @@ void Minimize::command(int narg, char **arg) error->all(FLERR, "Illegal minimize command: expected 4 arguments but found {}", narg); if (domain->box_exist == 0) - error->all(FLERR, "Minimize command before simulation box is defined"); + error->all(FLERR, "Minimize command before simulation box is defined" + utils::errorurl(33)); // ignore minimize command, if walltime limit was already reached if (timer->is_timeout()) return; diff --git a/src/output.cpp b/src/output.cpp index 60d84e715d..0602c4f52d 100644 --- a/src/output.cpp +++ b/src/output.cpp @@ -896,7 +896,7 @@ void Output::create_thermo(int narg, char **arg) // don't allow this so that dipole style can safely allocate inertia vector if (domain->box_exist == 0) - error->all(FLERR,"Thermo_style command before simulation box is defined"); + error->all(FLERR,"Thermo_style command before simulation box is defined" + utils::errorurl(33)); // warn if previous thermo had been modified via thermo_modify command diff --git a/src/read_data.cpp b/src/read_data.cpp index 8d97b11243..79d88148c5 100644 --- a/src/read_data.cpp +++ b/src/read_data.cpp @@ -339,9 +339,11 @@ void ReadData::command(int narg, char **arg) "Reading a data file with shrinkwrap boundaries is not " "compatible with a MSM KSpace style"); if (domain->box_exist && !addflag) - error->all(FLERR, "Cannot use read_data without add keyword after simulation box is defined"); + error->all(FLERR, "Cannot use read_data without add keyword after simulation box is defined" + + utils::errorurl(34)); if (!domain->box_exist && addflag) - error->all(FLERR, "Cannot use read_data add before simulation box is defined"); + error->all(FLERR, "Cannot use read_data add before simulation box is defined" + + utils::errorurl(33)); if (offsetflag) { if (addflag == NONE) { error->all(FLERR, "Cannot use read_data offset without add keyword"); diff --git a/src/read_dump.cpp b/src/read_dump.cpp index 59fe6c6767..0f5356ecd9 100644 --- a/src/read_dump.cpp +++ b/src/read_dump.cpp @@ -80,7 +80,7 @@ ReadDump::~ReadDump() void ReadDump::command(int narg, char **arg) { if (domain->box_exist == 0) - error->all(FLERR,"Read_dump command before simulation box is defined"); + error->all(FLERR,"Read_dump command before simulation box is defined" + utils::errorurl(33)); if (narg < 2) utils::missing_cmd_args(FLERR, "read_dump", error); diff --git a/src/read_restart.cpp b/src/read_restart.cpp index 96f1c3d072..594ae377d3 100644 --- a/src/read_restart.cpp +++ b/src/read_restart.cpp @@ -52,7 +52,7 @@ void ReadRestart::command(int narg, char **arg) if (narg != 1 && narg != 2) error->all(FLERR,"Illegal read_restart command"); if (domain->box_exist) - error->all(FLERR,"Cannot read_restart after simulation box is defined"); + error->all(FLERR,"Cannot read_restart after simulation box is defined" + utils::errorurl(34)); MPI_Barrier(world); double time1 = platform::walltime(); diff --git a/src/replicate.cpp b/src/replicate.cpp index 97a7569f64..5b221fde1d 100644 --- a/src/replicate.cpp +++ b/src/replicate.cpp @@ -52,7 +52,7 @@ void Replicate::command(int narg, char **arg) int i,n; if (domain->box_exist == 0) - error->all(FLERR,"Replicate command before simulation box is defined"); + error->all(FLERR,"Replicate command before simulation box is defined" + utils::errorurl(33)); if (narg < 3 || narg > 4) error->all(FLERR,"Illegal replicate command"); diff --git a/src/rerun.cpp b/src/rerun.cpp index 96491bab36..8115b3d5d4 100644 --- a/src/rerun.cpp +++ b/src/rerun.cpp @@ -41,7 +41,7 @@ Rerun::Rerun(LAMMPS *lmp) : Command(lmp) {} void Rerun::command(int narg, char **arg) { if (domain->box_exist == 0) - error->all(FLERR,"Rerun command before simulation box is defined"); + error->all(FLERR,"Rerun command before simulation box is defined" + utils::errorurl(33)); if (narg < 2) error->all(FLERR,"Illegal rerun command"); diff --git a/src/reset_atoms_id.cpp b/src/reset_atoms_id.cpp index 9992a49b28..b38b28b6a1 100644 --- a/src/reset_atoms_id.cpp +++ b/src/reset_atoms_id.cpp @@ -53,7 +53,7 @@ ResetAtomsID::ResetAtomsID(LAMMPS *lmp) : Command(lmp) void ResetAtomsID::command(int narg, char **arg) { if (domain->box_exist == 0) - error->all(FLERR, "Reset_atoms id command before simulation box is defined"); + error->all(FLERR, "Reset_atoms id command before simulation box is defined" + utils::errorurl(33)); if (atom->tag_enable == 0) error->all(FLERR, "Cannot use reset_atoms id unless atoms have IDs"); for (const auto &ifix : modify->get_fix_list()) diff --git a/src/reset_atoms_image.cpp b/src/reset_atoms_image.cpp index 63030c632b..b57c98905f 100644 --- a/src/reset_atoms_image.cpp +++ b/src/reset_atoms_image.cpp @@ -39,7 +39,7 @@ ResetAtomsImage::ResetAtomsImage(LAMMPS *lmp) : Command(lmp) {} void ResetAtomsImage::command(int narg, char **arg) { if (domain->box_exist == 0) - error->all(FLERR, "Reset_atoms image command before simulation box is defined"); + error->all(FLERR, "Reset_atoms image command before simulation box is defined" + utils::errorurl(33)); if (atom->tag_enable == 0) error->all(FLERR, "Cannot use reset_atoms image unless atoms have IDs"); if (atom->avec->bonds_allow == 0) diff --git a/src/reset_atoms_mol.cpp b/src/reset_atoms_mol.cpp index 66dd886059..54d3bbcc76 100644 --- a/src/reset_atoms_mol.cpp +++ b/src/reset_atoms_mol.cpp @@ -61,7 +61,7 @@ ResetAtomsMol::~ResetAtomsMol() void ResetAtomsMol::command(int narg, char **arg) { if (domain->box_exist == 0) - error->all(FLERR, "Reset_atoms mol command before simulation box is defined"); + error->all(FLERR, "Reset_atoms mol command before simulation box is defined" + utils::errorurl(33)); if (atom->tag_enable == 0) error->all(FLERR, "Cannot use reset_atoms mol unless atoms have IDs"); if (atom->molecular != Atom::MOLECULAR) error->all(FLERR, "Can only use reset_atoms mol on molecular systems"); diff --git a/src/run.cpp b/src/run.cpp index 516bce5d0b..5444297e5d 100644 --- a/src/run.cpp +++ b/src/run.cpp @@ -39,7 +39,7 @@ void Run::command(int narg, char **arg) if (narg < 1) utils::missing_cmd_args(FLERR, "run", error); if (domain->box_exist == 0) - error->all(FLERR,"Run command before simulation box is defined"); + error->all(FLERR,"Run command before simulation box is defined" + utils::errorurl(33)); // ignore run command, if walltime limit was already reached diff --git a/src/velocity.cpp b/src/velocity.cpp index 1f0a757d7c..ba95fdc631 100644 --- a/src/velocity.cpp +++ b/src/velocity.cpp @@ -51,7 +51,7 @@ void Velocity::command(int narg, char **arg) if (narg < 2) utils::missing_cmd_args(FLERR, "velocity", error); if (domain->box_exist == 0) - error->all(FLERR,"Velocity command before simulation box is defined"); + error->all(FLERR,"Velocity command before simulation box is defined" + utils::errorurl(33)); if (atom->natoms == 0) error->all(FLERR,"Velocity command with no atoms existing"); diff --git a/src/write_coeff.cpp b/src/write_coeff.cpp index 5a7177f62f..19f512fab1 100644 --- a/src/write_coeff.cpp +++ b/src/write_coeff.cpp @@ -39,7 +39,7 @@ static constexpr int BUF_SIZE = 256; void WriteCoeff::command(int narg, char **arg) { if (domain->box_exist == 0) - error->all(FLERR, "Write_coeff command before simulation box is defined"); + error->all(FLERR, "Write_coeff command before simulation box is defined" + utils::errorurl(33)); if (narg != 1) utils::missing_cmd_args(FLERR, "write_coeff", error); diff --git a/src/write_data.cpp b/src/write_data.cpp index 85950f3b47..6f05ae1ac2 100644 --- a/src/write_data.cpp +++ b/src/write_data.cpp @@ -51,7 +51,7 @@ WriteData::WriteData(LAMMPS *lmp) : Command(lmp) {} void WriteData::command(int narg, char **arg) { if (domain->box_exist == 0) - error->all(FLERR,"Write_data command before simulation box is defined"); + error->all(FLERR,"Write_data command before simulation box is defined" + utils::errorurl(33)); if (narg < 1) utils::missing_cmd_args(FLERR, "write_data", error); diff --git a/src/write_restart.cpp b/src/write_restart.cpp index a2022deeb9..ecf6b7bc08 100644 --- a/src/write_restart.cpp +++ b/src/write_restart.cpp @@ -59,7 +59,7 @@ WriteRestart::WriteRestart(LAMMPS *lmp) : Command(lmp) void WriteRestart::command(int narg, char **arg) { if (domain->box_exist == 0) - error->all(FLERR,"Write_restart command before simulation box is defined"); + error->all(FLERR,"Write_restart command before simulation box is defined" + utils::errorurl(33)); if (narg < 1) utils::missing_cmd_args(FLERR, "write_restart", error); // if filename contains a "*", replace with current timestep