modernize access to list of fixes
This commit is contained in:
@ -176,12 +176,11 @@ void FixWallReflect::init()
|
|||||||
}
|
}
|
||||||
|
|
||||||
int nrigid = 0;
|
int nrigid = 0;
|
||||||
for (int i = 0; i < modify->nfix; i++)
|
for (const auto &ifix : modify->get_fix_list())
|
||||||
if (modify->fix[i]->rigid_flag) nrigid++;
|
if (ifix->rigid_flag) nrigid++;
|
||||||
|
|
||||||
if (nrigid && comm->me == 0)
|
if (nrigid && (comm->me == 0))
|
||||||
error->warning(FLERR,"Should not allow rigid bodies to bounce off "
|
error->warning(FLERR,"Should not use reflecting walls with rigid bodies");
|
||||||
"relecting walls");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|||||||
@ -55,9 +55,9 @@ void ResetAtomsID::command(int narg, char **arg)
|
|||||||
error->all(FLERR, "Reset_atoms id command before simulation box is defined");
|
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");
|
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++)
|
for (const auto &ifix : modify->get_fix_list())
|
||||||
if (modify->fix[i]->stores_ids)
|
if (ifix->stores_ids)
|
||||||
error->all(FLERR, "Cannot use reset_atoms id when a fix exists that stores atom 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");
|
if (comm->me == 0) utils::logmesg(lmp, "Resetting atom IDs ...\n");
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user