Hi Guys
I am new to Gmsh. Please refer to the below Python code.
The code develops 2 squares with a mesh, how would I go about uniting the two surfaces, so that when a mesh is developed there is a straight line along the intersection?
Kind regards
Mishal Mohanlal
import gmsh
import sys
gmsh.initialize()
lc = 1
point1 = gmsh.model.geo.add_point(0, 0, 0, lc)
point2 = gmsh.model.geo.add_point(0, 10, 0, lc)
point3 = gmsh.model.geo.add_point(10, 10, 0, lc)
point4 = gmsh.model.geo.add_point(10, 0, 0, lc)
point5 = gmsh.model.geo.add_point(0, 5, 0, lc)
point6 = gmsh.model.geo.add_point(5, 5, 0, lc)
point7 = gmsh.model.geo.add_point(5, 0, 0, lc)
line1 = gmsh.model.geo.add_line(point1, point2)
line2 = gmsh.model.geo.add_line(point2, point3)
line3 = gmsh.model.geo.add_line(point3, point4)
line4 = gmsh.model.geo.add_line(point4, point1)
line5 = gmsh.model.geo.add_line(point1, point5)
line6 = gmsh.model.geo.add_line(point5, point6)
line7 = gmsh.model.geo.add_line(point6, point7)
line8 = gmsh.model.geo.add_line(point7, point1)
face1 = gmsh.model.geo.add_curve_loop([line1, line2, line3, line4])
face2 = gmsh.model.geo.add_curve_loop([line5, line6, line7, line8])
gmsh.model.geo.add_plane_surface([face1])
gmsh.model.geo.add_plane_surface([face2])
gmsh.model.geo.synchronize()
gmsh.model.mesh.generate()
gmsh.write(âGFG.mshâ)
if âcloseâ not in sys.argv:
gmsh.fltk.run()
gmsh.finalize()