Meshing coplanar faces
I am trying to produce a mesh which has some coplanar surfaces in the middle which aren't connected.
When I do this with a basic example (two boxes), there is no problem.
basic_script.py
import gmsh
gmsh.initialize()
gmsh.model.occ.addBox(0, 0, 0, 1, 1, 1)
gmsh.model.occ.addBox(0, 0, 1, 1, 1, 1)
gmsh.model.occ.synchronize()
gmsh.fltk.run()
gmsh.model.mesh.generate()
gmsh.finalize()
However when I try this with a mesh more representative of my problem (where the upper and lower regions either side of the disconnected surfaces are connected), I get Error : Invalid boundary mesh (overlapping facets) on surface 19 surface 7
- these are the surfaces which can be seen overlaid on each other in the image:
representative_script.py
import gmsh
gmsh.initialize()
a = gmsh.model.occ.addBox(0, 0, 0, 0.3, 0.5, 0.1)
b = gmsh.model.occ.addBox(0, 0, 0.1, 0.1, 0.5, 0.1)
c = gmsh.model.occ.addBox(0.2, 0, 0.1, 0.1, 0.5, 0.1)
gmsh.model.occ.fragment([(3, a)], [(3, b), (3, c)])
d = gmsh.model.occ.addLine(15, 17)
e = gmsh.model.occ.addLine(16, 18)
f = gmsh.model.occ.addSurfaceFilling(gmsh.model.occ.addCurveLoop([11, 18, 15, 17]))
g = gmsh.model.occ.addSurfaceFilling(gmsh.model.occ.addCurveLoop([23, d, 28, e]))
h = gmsh.model.occ.addSurfaceFilling(gmsh.model.occ.addCurveLoop([11, 22, d, 27]))
i = gmsh.model.occ.addSurfaceFilling(gmsh.model.occ.addCurveLoop([15, 24, e, 29]))
j = gmsh.model.occ.addSurfaceLoop([10, 14, f, g, h, i])
gmsh.model.occ.addVolume([j])
gmsh.model.occ.synchronize()
gmsh.fltk.run()
gmsh.model.mesh.generate()
gmsh.finalize()
Am I doing something wrong or is what I'm trying to do unsupported (and if so why does it work in the basic example)? Is there an easy way to achieve this?
Thanks
Edited by Leo Nolan