71 std::span<Cell *const> local_cells, std::span<Cell *const> ghost_cells,
72 std::function<
bool(
Cell const *,
Cell const *)> wrap_predicate =
nullptr) {
74 std::unordered_set<ParticleList const *> ghost_set;
75 ghost_set.reserve(ghost_cells.size());
76 for (
Cell *c : ghost_cells) {
77 ghost_set.insert(&c->particles());
81 for (
Cell *c : local_cells) {
82 c->m_is_boundary =
false;
87 for (
Cell *c : local_cells) {
88 for (
Cell *n : c->neighbors().all()) {
89 if (ghost_set.count(&n->particles()) ||
90 (wrap_predicate && wrap_predicate(c, n))) {
91 c->m_is_boundary =
true;
115 std::span<Cell *const> local_cells) {
117 std::unordered_map<ParticleList const *, Cell *> pl_to_cell;
118 pl_to_cell.reserve(local_cells.size());
119 for (
Cell *c : local_cells) {
120 pl_to_cell[&c->particles()] = c;
125 for (
auto const &sr : nc.send) {
126 auto it = pl_to_cell.find(sr.cell);
127 if (it != pl_to_cell.end()) {
128 it->second->m_is_boundary =
true;
134 for (
auto const &lc : plan.
local) {
135 auto it = pl_to_cell.find(lc.src);
136 if (it != pl_to_cell.end()) {
137 it->second->m_is_boundary =
true;
void mark_boundary_cells(std::span< Cell *const > local_cells, std::span< Cell *const > ghost_cells, std::function< bool(Cell const *, Cell const *)> wrap_predicate=nullptr)
Classify each local cell as interior or boundary.