modernize access to list of fixes
This commit is contained in:
@ -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");
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
@ -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");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user