def _get_num_ve_sve_and_max_num_cells(cell_fracs):
    """
    Calculate the num_ve, num_sve and max_num_cells

    Parameters
    ----------
    cell_fracs : structured array, optional
        A sorted, one dimensional array,
        each entry containing the following fields:

            :idx: int
                The volume element index.
            :cell: int
                The geometry cell number.
            :vol_frac: float
                The volume fraction of the cell withing the mesh ve.
            :rel_error: float
                The relative error associated with the volume fraction.

    Returns
    -------
    num_ve : int
        Number of the total voxels
    num_sve : int
        Number of the total subvoxels, eqaul to or greater than num_ve
    max_num_cells : int
        Max number of cells (subvoxels) in a voxel
    """
    num_sve = len(cell_fracs)
    num_ve = len(set(cell_fracs["idx"]))
    max_num_cells = -1
    for i in range(num_sve):
        max_num_cells = max(max_num_cells, len(cell_fracs[cell_fracs["idx"] == i]))
    return num_ve, num_sve, max_num_cells