Defining Physical groups using color gradient
Hi, I started using gmsh a couple weeks ago for research as my mentor and I are trying to run FEM on a particle. The goal of using gmsh is for us to be able to process jpg and/or png files of particle(s) by assigning physical groups to them using the color gradient and outputting a meshed file with physical boundaries defined. Further, we would like to be able to adjust the quality of the mesh to become more coarse as it diverges from the boundary of the particle.
The approach we took on attempting the above is shown on the geo code below: RealCode1.geo
We were able to process the image and apply the mesh below:
The issue with the code above is how we are not able to define the shape itself as a physical group and therefore will not be able to apply boundary conditions, and have the desired flexibility to edit our mesh.
To sum up, the question I have is: How to define objects within an imported jpg/png file into a physical group based on its color gradient? I am asking this as we are going to work with a lot more complicated geometries and therefore will need a reliable method of automatically defining physical groups.