How to refine a mesh (through the script) imported from GMSH?

You can use the refine and adapt commands, as used in: