def iterate_ids(cells, id_range):
    """Iterates over IDs of given cells

    It uses an ID range and expects the IDs to be assigned.

    NOTE: never use zero as a cell ID, it causes the derefinement subroutines
    to crash, since they internally set the ID of removed cells to zero

    """
    return map(id_range.get_id, cells)
