mesh size callback not reset on finalize()
It appears that the mesh size callback is not reset when calling finalize().
MWE for pygmsh. (Let me know if you need a vanilla gmsh MWE.)
import math
import pygmsh
with pygmsh.occ.Geometry() as geom:
geom.characteristic_length_max = 1.0e-1
geom.add_ball([0, 0, 0], 1.0)
mesh = geom.generate_mesh()
print(len(mesh.points))
with pygmsh.geo.Geometry() as geom:
geom.set_mesh_size_callback(
lambda dim, tag, x, y, z: 5.0e-2 + 0.1 * math.sqrt(x ** 2 + y ** 2)
)
with pygmsh.occ.Geometry() as geom:
geom.characteristic_length_max = 1.0e-1
geom.add_ball([0, 0, 0], 1.0)
mesh = geom.generate_mesh()
print(len(mesh.points))
3999
9351
(The two meshes should have the same number of nodes.)