modernize

This commit is contained in:
Axel Kohlmeyer
2023-04-21 12:23:35 -04:00
parent 8cfac6fd60
commit 30cdb635c2

View File

@ -148,21 +148,22 @@ int FixNeighHistory::setmask()
void FixNeighHistory::init() void FixNeighHistory::init()
{ {
if (atom->tag_enable == 0) if (atom->tag_enable == 0) error->all(FLERR, "Neighbor history requires that atoms have IDs");
error->all(FLERR,"Neighbor history requires atoms have IDs");
// this fix must come before any fix which migrates atoms in its pre_exchange() // this fix must come before any fix which migrates atoms in its pre_exchange()
// because this fix's pre_exchange() creates per-atom data structure // because this fix's pre_exchange() creates per-atom data structure
// that data must be current for atom migration to carry it along // that data must be current for atom migration to carry it along
for (int i = 0; i < modify->nfix; i++) { for (const auto &ifix : modify->get_fix_list()) {
if (modify->fix[i] == this) break; if (ifix == this) break;
if (modify->fix[i]->pre_exchange_migrate) if (ifix->pre_exchange_migrate)
error->all(FLERR,"Fix neigh_history comes after a fix which " error->all(FLERR,
"migrates atoms in pre_exchange"); "Pair styles using neighbor history must be defined before "
"fix {} {} which migrates atoms in pre_exchange",
ifix->id, ifix->style);
} }
// setup data struct // setup data structs
allocate_pages(); allocate_pages();
} }