Piecewise constants on the bounday of 2-D domain

So I can create a piecewise linear FE space on a boundary of a 2-D square. But there does not seem to be a way to create piecewise constants. Is this just not doable?

for that we have the space of element-wise polynomials on surfaces:

fes = SurfaceL2(mesh, order=0)

Yes, but does this work on a sub-domain of co-dimension 1? Do I need to add an argument, like “definedon=”?

For this, you can use facetfespace, and use definedon=“”

Thanks. Actually, it needs to be:

bdy_L2 = FacetFESpace(mesh, order=0, definedon=“”, definedonbound=“outer”)