UFL Measures on Sub-domains not Evaluated

To calculate the «length» of a domain, you would need an interface marker of the facets of the subdomain, or you can create a submesh for each subdomain and then evaluate ds as done for the full mesh.

Note that your example is not reproducible as you haven’t provided a mesh.

If you want to make an interface marker after meshing see

in Discontinuity at interface using mixed domains - #2 by dokken