Fragments with shared surfaces - issue?
Dear all.
In the example below, I have two cylinders, which somewhat overlap (see image_1). I would like that both volumes share the surfaces at the places where they intersect. This works fine, if they have exactly the same surfaces, like the bottom disk, which has the label No. 6. However, the thinner ring (label No. 10) in image_2 is only part of cylinder 1 and not cylinder 2, although it is logically a part also of the ring of cylinder 2 (label No. 4). Obviously, the ring of cylinder 2 needs to be subdivided. It needs to have some additional vertices, which introduces the same thin ring surface as the one of cylinder 1.
Overall, is gmsh.model.occ.fragment
meant like this or is there a bug? If it is not a bug, how can I also share the inner ring, so subdividing the larger ring of cylinder 2?
Thanks for some help.
Here! the example code:
import numpy as np
import scipy.constants as const
import gmsh
gmsh.initialize()
cyl1_x = 0.0
cyl1_y = 0.0
cyl1_z = 0.0
cyl1_vx = 0.0
cyl1_vy = 0.0
cyl1_vz = 50.0
cyl1_size = 100.0
cyl2_x = 0.0
cyl2_y = 0.0
cyl2_z = 40.0
cyl2_vx = 0.0
cyl2_vy = 0.0
cyl2_vz = 50.0
cyl2_size = 50.0
ID_cyl1 = gmsh.model.occ.addCylinder(cyl1_x,
cyl1_y,
cyl1_z,
cyl1_vx,
cyl1_vy,
cyl1_vz,
cyl1_size,
angle=2.0*const.pi)
ID_cyl2 = gmsh.model.occ.addCylinder(cyl2_x,
cyl2_y,
cyl2_z,
cyl2_vx,
cyl2_vy,
cyl2_vz,
cyl2_size,
angle=2.0*const.pi)
ID_result = 1000
ID_result_b = gmsh.model.occ.fragment([(3, ID_cyl1)],
[(3, ID_cyl2)],
removeObject=False,
removeTool=False,
tag=ID_result)
print(ID_result)
print(ID_result_b)
gmsh.model.occ.synchronize()
gmsh.model.mesh.generate(3)
gmsh.write("aha_01.msh")