How to set physical names and groups to a union object in gmsh for python?
import warnings
warnings.filterwarnings("ignore")
import gmsh
gmsh.initialize()
gmsh.model.add("slab")
L, B, H, r = 2.0, 12.0, 0.5, 0.0416
slab = gmsh.model.occ.addBox(0, 0, 0, L, B, H)
gmsh.model.occ.synchronize()
rebar_circle_front = [-L/2,-B/2,H/2]
rebar_circle_back = [-L/2,B/2,H/2]
rebar = gmsh.model.occ.addCylinder(0.5, 0,0.2,0, B, 0, r)
gmsh.model.occ.synchronize()
slabdofs = gmsh.model.occ.cut([(3, slab)], [(3, rebar)])
gmsh.model.occ.synchronize()
rebar_circle_front = [-L/2,-B/2,H/2]
rebar_circle_back = [-L/2,B/2,H/2]
rebar = gmsh.model.occ.addCylinder(0.5, 0,0.2,0, B, 0, r)
model3D = gmsh.model.geo.__enter__()
#union = model3D.boolean_union([slab, rebar])
volumes = gmsh.model.getEntities(dim=3)
slab_marker = 11
rebar_marker = 12
gmsh.model.addPhysicalGroup(volumes[0][0], [volumes[0][1]], slab_marker)
gmsh.model.setPhysicalName(volumes[0][0], slab_marker, "Fluid volume")
gmsh.model.mesh.generate(3)
gmsh.write("mesh3D.msh")
So far I am still looking for where "boolean_union" is in the gmsh tree and have not found a way to with the gmsh package. What I would like to do is set the slab as one physical group with a name and all of the steel I will be using as one physical group with a name.
Anyone can shed some light on how to do this with gmsh package?