There are plenty of posts on this subject.
See for instance:
https://jsdokken.com/dolfinx-tutorial/chapter3/subdomains.html
and Want to import already defined physical groups of Microstructure in Gmsh to FEnics - #23 by dokken
There are plenty of posts on this subject.
See for instance:
https://jsdokken.com/dolfinx-tutorial/chapter3/subdomains.html
and Want to import already defined physical groups of Microstructure in Gmsh to FEnics - #23 by dokken