modernize access to list of fixes

This commit is contained in:
Axel Kohlmeyer
2023-07-16 15:20:36 -04:00
parent fd0a72eab5
commit 89d82fde22
2 changed files with 7 additions and 8 deletions

View File

@ -176,12 +176,11 @@ void FixWallReflect::init()
}
int nrigid = 0;
for (int i = 0; i < modify->nfix; i++)
if (modify->fix[i]->rigid_flag) nrigid++;
for (const auto &ifix : modify->get_fix_list())
if (ifix->rigid_flag) nrigid++;
if (nrigid && comm->me == 0)
error->warning(FLERR,"Should not allow rigid bodies to bounce off "
"relecting walls");
if (nrigid && (comm->me == 0))
error->warning(FLERR,"Should not use reflecting walls with rigid bodies");
}
/* ---------------------------------------------------------------------- */

View File

@ -55,9 +55,9 @@ void ResetAtomsID::command(int narg, char **arg)
error->all(FLERR, "Reset_atoms id command before simulation box is defined");
if (atom->tag_enable == 0) error->all(FLERR, "Cannot use reset_atoms id unless atoms have IDs");
for (int i = 0; i < modify->nfix; i++)
if (modify->fix[i]->stores_ids)
error->all(FLERR, "Cannot use reset_atoms id when a fix exists that stores atom IDs");
for (const auto &ifix : modify->get_fix_list())
if (ifix->stores_ids)
error->all(FLERR, "Cannot use reset_atoms id with a fix {} storing atom IDs", ifix->style);
if (comm->me == 0) utils::logmesg(lmp, "Resetting atom IDs ...\n");