How to define function space on subdomain in dolfinx?

Suppose that I have a domain and a marker in
domain, markers = create_nested_rectangles()
here the functioncreate_nested_rectangles() is my own function, then the domain is foreground if the corresponding value of the markers is 1, then how to generate the function space of the subdomain?

See for instance
http://jsdokken.com/FEniCS-workshop/src/multiphysics/submeshes.html

2 Likes