Mark subdomains with meshing software?

Hi there,

Until now I only worked with geometry where defining subdomains with FEniCS was a simple task. Now I have a 3D geometry where it’s not so trivial to mark the subdomains. My question is whether there is graphical software that allows me to mark subdomains of a 3D model.

You can use for instance gmsh
I have made a tutorial on how to use their Python interface: https://jsdokken.com/converted_files/tutorial_gmsh.html
And gmsh has plenty of tutorials on how to mesh and mark complex domains on their webpage

1 Like

To add to what dokken said GMSH is very easy to use for that. It all comes down to choosing physical surfaces and volumes on a graphical interface. It also has a good coding feature that helps you make general boundaries. Save the code below in .geo and open it with GMSH. Pay attention to the last two line sthat label the surface with 1 and the volume with 2. You can use the exact same labels in fenics after you convert the mesh to .xml. This is extremely helpful when it comes to several domains and boundaries.

// Gmsh project created on Sun Nov 22 17:35:06 2020
SetFactory("OpenCASCADE");
//+
Sphere(1) = {0, 0, 0, 0.5, -Pi/2, Pi/2, 2*Pi};
//+
Physical Surface(1) = {1};
//+
Physical Volume(2) = {1};
1 Like