Create irregular mesh in Gmsh with Python API

Hi all,

Could I ask if you know how to implement the following irregular mesh?

Kindly
Qiong

Each color is a material domain in Fenics

Your question is fairly general. what format is this image in, that you want to interpret as a mesh?

I would suggest using tools such as Gmsh to define each of the regions, and then read it into fenics.

Hi Dokken,

Do you mean give each color a tag in Gmsh?

Gmsh is a triangulation/meshing library. So you can create each of these polygons, use boolean fragments to create each subdomain, use Gmsh physical surface to mark each surface with an integer tag, and read these into FEniCS/FEniCSx.
See for instance: Electromagnetics example — FEniCSx tutorial