I would like to run a fenicsx simulation on a family of gmsh meshes, with decreasing mesh size, in order to perform a convergence test. I have two options:
Creating a mesh in the python API of gmsh, like explained here and here. This works well, however one can not inspect the mesh easily. One can export the mesh and check it in the gmsh UI or in paraview, but these are extra steps, that one has to perform.
Creating a mesh in gmsh, using .geo files. This works well, the gmsh UI can immediately show the result and the interplay between the .geo scripts and the visualization is very user friendly. E.g. one can create points, define a surface and read the implicitely defined identification tag (that every geometric entity has) using the UI. But: after importing the mesh to python, it can not be refined. I can not perform convergence tests like this.
How do the experts here handle this? Whats the best way to do it?
Is it preferred to refine a mesh (created by gmsh or by dolfinx) inside a python script or to create a family of meshes with decreasing element size and importing them one by one?
I tried to implement the first case based on the documentation:
This depends on your geometry. If the boundary of the geometry is accurately represented on the coarse grid, i would refine it using dolfinx. However, it there are large curvatures, meaning that the coarse and finer grids would look significantly different, i would use Gmsh.