add explanations for "before/after simulation box is defined" errors

This commit is contained in:
Axel Kohlmeyer
2025-03-21 20:17:17 -04:00
parent 649fd86e11
commit 1b58a4695b
45 changed files with 107 additions and 73 deletions

View File

@ -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]);
}