You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to generate a 3D mesh which is composed of two cylinders of different radii stacked on top of each other. I would like to refine the mesh along the circle at their intersection (where the arrow is shown here).
I've tried to adapt the examples shown in the docs but haven't had much luck so far, do you have any tips for how I can proceed with this?
with pygmsh.occ.Geometry() as geom:
geom.characteristic_length_max = 0.02
cylinders = [
geom.add_cylinder([0.0, 0.0, 0.0], [0.0, 1, 0.0], 0.1),
geom.add_cylinder([0.0, 1, 0.0], [0.0, 0.5, 0.0], 0.2),
]
geom.boolean_union(cylinders)
# refine mesh around the intersection of the two cylinders
# (𝑥)**2+(𝑦)2+(𝑧)**2=𝑟**2 where y = 1
# Code below causes this error: TypeError: <lambda>() takes 5 positional arguments but 6 were given
# geom.set_mesh_size_callback(
# lambda dim, tag, x, y, z: (((x**2 + y**2 + z**2)))
# )
# Or could use something like this work? I couldn't find any way to add a full circle
# circ = geom.add_circle(
# add circle defined along intersection of cylinders
# )
# field0 = geom.add_boundary_layer(
# edges_list=[circ.curves[0]],
# ........
# )
mesh = geom.generate_mesh()
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi,
I'm trying to generate a 3D mesh which is composed of two cylinders of different radii stacked on top of each other. I would like to refine the mesh along the circle at their intersection (where the arrow is shown here).
I've tried to adapt the examples shown in the docs but haven't had much luck so far, do you have any tips for how I can proceed with this?
Thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions