Using 'setCompound' with the OCC kernel
Hello there,
I am trying to mesh a 2D geometry using the python API, where the start and end points of two curves are very close to each other and have a smaller distance than the given element size. This results in highly distorted elements, which I would like to avoid. The command gmsh.model.mesh.setCompound()
sounds like it would fix this problem if I could combine the corresponding curve with adjacent ones to form a compound. However, it seems that the command is disregarded since all the start and end points of the individual curves are still element nodes:
There is no error message. Here is a minimal example including geometry (window.brep):
import gmsh
import sys
import os
element_size = 0.04
gmsh.initialize()
path = os.getcwd()
v = gmsh.model.occ.importShapes(os.path.join(path, 'window.brep'), highestDimOnly=True)
gmsh.model.occ.synchronize()
gmsh.option.setNumber("Mesh.MeshSizeMax", element_size)
gmsh.option.setNumber("Mesh.Algorithm", 8)
gmsh.option.setNumber('Mesh.RecombineAll', 1)
gmsh.option.setNumber('Mesh.RecombinationAlgorithm', 1)
gmsh.model.mesh.setCompound(1, [tag for _, tag in gmsh.model.getEntities(1)])
gmsh.model.mesh.generate(2)
gmsh.model.mesh.removeDuplicateNodes()
# Launch the GUI to see the results:
if '-nopopup' not in sys.argv:
gmsh.fltk.run()
gmsh.finalize()
I had already researched the problem and found Issue #1568 (closed). Are the problems possibly caused by the fact that the change to the OCC kernel changes the complexity of the geometry, so that a reparameterization is not possible?
I would be very happy if you could help me to find out why it does not work.
Thanks in advance!