let discard_cell = match topology_boundary with | Periodic -> (fun _ -> false) | Bounded -> (fun cell -> Topo.distance_to_boundary cell < min_dist_to_boundary)