problem with the generation of boundary layers in a simple cylinder
I am trying to replicate the example of : https://gitlab.onelab.info/gmsh/gmsh/blob/master/examples/api/tube_boundary_layer.py#L26 with a single pipe
However, when getting the boundaries of the created "top" surfaces this error arise:
Traceback (most recent call last):
File "test.py", line 55, in <module>
bnd_ent = gmsh.model.getBoundary(top_ent)
File "/home/marco/.local/lib/python3.8/site-packages/gmsh.py", line 866, in getBoundary
raise Exception(logger.getLastError())
Exception: Unknown model face with tag 10
From what I understood the error might be due to a bug? the part of the code that produces the error is this:
import gmsh
import math
import os
import sys
import numpy as np
# MESH PARAMETERS
minSize = 0.0005
maxSize = 0.001
len = 1
radius = 0.1
gmsh.initialize()
gmsh.model.add("pipe")
createdCyl = gmsh.model.occ.addCylinder(0,0,0, 0, 1, 0, radius)
gmsh.model.occ.synchronize()
gmsh.model.occ.remove(gmsh.model.occ.getEntities(3))
gmsh.model.occ.synchronize()
gmsh.model.occ.remove([(2,1), (2,2)]) # fixme: automate this
gmsh.model.occ.synchronize()
gmsh.option.setNumber('Geometry.ExtrudeReturnLateralEntities', 0)
gmsh.model.occ.synchronize()
n = np.linspace(1, 1, 5)
d = np.logspace(-4, -3, 5)
e = gmsh.model.geo.extrudeBoundaryLayer(gmsh.model.getEntities(2), n, -d, True)
gmsh.model.occ.synchronize()
# get "top" surfaces created by extrusion
top_ent = [s for s in e if s[0] == 2]
top_surf = [s[1] for s in top_ent]
gmsh.model.occ.synchronize()
bnd_ent = gmsh.model.getBoundary(top_ent)
# CODE BREAKS DOWN HERE
#bnd_curv = [c[1] for c in bnd_ent]
#gmsh.model.mesh.generate()
gmsh.model.occ.synchronize()
gmsh.write("pipe.vtk")
# Launch the GUI to see the results:
if '-nopopup' not in sys.argv:
gmsh.fltk.run()
gmsh.finalize()