Handle next_shell_id in compute_distance2boundary