add check to disallow custom neighbor list cutoffs larger than the communication cutoff.

This commit is contained in:
Axel Kohlmeyer
2023-06-29 21:20:07 -04:00
parent 14462d8f80
commit b7024288b6

View File

@ -837,9 +837,20 @@ int Neighbor::init_pair()
// similar to what vanilla Nbin::coord2atom() does now in atom2bin
if (style == Neighbor::BIN) {
for (i = 0; i < nrequest; i++)
for (i = 0; i < nrequest; ++i)
if (requests[i]->occasional && requests[i]->ghost)
error->all(FLERR,"Cannot request an occasional binned neighbor list with ghost info");
error->all(FLERR, "Cannot request an occasional binned neighbor list with ghost info");
}
// check requests with a custom neighbor list cutoff to make sure the cutoff is within
// the communication cutoff. For perpetual lists, neighbor list skin is added later.
const double comm_cutoff = comm->get_comm_cutoff();
for (i = 0; i < nrequest; ++i) {
if (requests[i]->cut) {
if (comm_cutoff < (requests[i]->cutoff + (requests[i]->occasional ? 0.0 : skin)))
error->all(FLERR, "Custom neighbor list cutoff too large for communication cutoff");
}
}
// morph requests in various ways