Creating meshs with subdomains

It seems that mshr was removed in FEnicSx. In @dokken 's tutorial (Defining subdomains for different materials — FEniCSx tutorial) he uses gmsh. Is there any other way for creating meshes in subdomains without using gmsh? Do we need to use external meshing tools now in FEnicSx?
mshr looked like a nice utility by the way.

Yes, gmsh is the recommended way to make meshes if you need something more complicated than the standard rectangle or box meshes (e.g. a mesh with subdomains). You can also use locate_dofs_geometrical() to avoid having to use gmsh like this tutorial. You do have to construct a marking function to do this though. This can get a bit tedious for truly complicated geometries.

The gmsh documentation has quite a few examples of how to construct and process various meshes and save out the “physical group” information. If you have another software to make meshes, I would also look at meshio (which can handle conversions between many many types of mesh inputs), but you will still need to import celltag information in that case.

1 Like

Very interesting. Thanks @jkrokowski .