Internal surface with quadrilateral elements inside unstructured mesh
Dear developers,
I was wondering how to create a structured mesh of an internal surface within an unstructured mesh. An simple example is this (also attached). With this code I get an exception:
Error : No elements in volume 1
Not setting the internal rectangle as transfinite works nicely (of course). Thanks a lot for the good work!
import gmsh
gmsh.initialize()
gmsh.model.add("internal_quads")
factory = gmsh.model.occ
box = factory.addBox(0, 0, 0, 1, 1, 1)
dx = 0.5
dy = 0.5
rect = factory.addRectangle(0.2, 0.2, 0.5, dx, dy)
factory.fragment([(3, box)], [(2, rect)])
factory.synchronize()
for s in factory.getEntities(2):
if abs(factory.getMass(2, s[1]) - dx * dy) < 1e-5:
gmsh.model.mesh.setTransfiniteAutomatic([s])
factory.synchronize()
gmsh.model.mesh.generate(3)
gmsh.write("internal_quads.msh")
gmsh.finalize()
Edited by A Johansson