def METHOD_NAME(mesh):
    if mesh.ufl_cell().sub_cells()[0].cellname() == "quadrilateral":
        # RTCF1 element on a hexahedron
        W0_h = FiniteElement("RTCF", "quadrilateral", 1)
        W1_h = FiniteElement("DQ", "quadrilateral", 0)
    else:
        # BDM1 element on a prism
        W0_h = FiniteElement("BDM", "triangle", 1)
        W1_h = FiniteElement("DG", "triangle", 0)
    W0_v = FiniteElement("DG", "interval", 0)
    W0 = HDiv(TensorProductElement(W0_h, W0_v))
    W1_v = FiniteElement("CG", "interval", 1)
    W1 = HDiv(TensorProductElement(W1_h, W1_v))
    return FunctionSpace(mesh, W0+W1)