How to create non-uniform mesh

Hello. I would like to create a unit square domain but apply different mesh sizes to different parts of the square.

I want to partition the square into three different parts (i) left: 0 < x < 0.1, (ii) middle: 0.1 < x < 0.9 and (iii) right: 0.9 < x < 1.0. The left and right parts should be finer and the middle part should be coarse. When I read the tutorial, it just mentioned how to create different subdomains but did not explain how to apply different meshes to different parts. Could anybody help me?

Thank you.

You should use external mesh generators, such as Gmsh for this purpose. Gmsh has a large number of tutorials: tutorial · master · gmsh / gmsh · GitLab

1 Like

Thanks for providing the resource.