Extrude a 2D mesh without re-meshing as a workaround for extrusion with quasi-structured quad mesh?
Hi,
As mentioned in #2091 (closed) and #2046 extrusion is not compatible with the quasi-structured algorithm.
For simple extrusion, as 1 layer extrusion, could it be possible to extrude the 2D mesh generated by the quasi-structured algorithm, without re-meshing the obtained extrusion, and thus by-passing this limitation? Here is a dummy test adapted from example t3. However, I cannot find a way to extrude the 2D mesh to 3D without running again the generate method.
Thanks!
import gmsh
import math
import sys
gmsh.initialize()
def createGeometryAndMesh():
# Clear all models and create a new one
gmsh.clear()
gmsh.model.add("t3")
# Copied from `t1.py'...
lc = 1e-2
gmsh.model.geo.addPoint(0, 0, 0, lc, 1)
gmsh.model.geo.addPoint(0.1, 0, 0, lc, 2)
gmsh.model.geo.addPoint(0.1, 0.3, 0, lc, 3)
gmsh.model.geo.addPoint(0, 0.3, 0, lc, 4)
gmsh.model.geo.addLine(1, 2, 1)
gmsh.model.geo.addLine(3, 2, 2)
gmsh.model.geo.addLine(3, 4, 3)
gmsh.model.geo.addLine(4, 1, 4)
gmsh.model.geo.addCurveLoop([4, 1, -2, 3], 1)
gmsh.model.geo.addPlaneSurface([1], 1)
gmsh.model.geo.synchronize()
gmsh.model.addPhysicalGroup(1, [1, 2, 4], 5)
gmsh.model.addPhysicalGroup(2, [1], name="My surface")
gmsh.model.geo.synchronize()
gmsh.option.set_number("Mesh.Algorithm", 11)
gmsh.option.set_number("Mesh.RecombinationAlgorithm", 3)
# Setting algorithm for surface does not seem to work
# gmsh.model.mesh.set_algorithm(dim=2, tag=1, val=11)
gmsh.model.mesh.generate(2)
gmsh.model.geo.extrude(
dimTags=[(2, 1)], dx=0, dy=0, dz=0.01, numElements=[1], recombine=True
)
gmsh.model.geo.synchronize()
gmsh.model.mesh.generate(3)
gmsh.write("t3.msh")
gmsh.option.setNumber("Mesh.SurfaceFaces", 1)
# Create the geometry and mesh it:
createGeometryAndMesh()
if "-nopopup" not in sys.argv:
gmsh.fltk.run()
gmsh.finalize()