Hi all,
Is there a tutorial on how to use pygmsh with FEniCS? For example, I have something like:
import pygmsh
import meshio
-snip-
def generate_box(geom, h1, h2, w):
lcar = 0.001
poly = geom.add_polygon(
[[0.0, 0.0, h1],
[w, 0.0, h1],
[w, w, h1],
[0.0, w, h1]],
lcar)
top, volume, lat = geom.extrude(poly.surface, [0, 0, h2-h1])
bottom = poly.surface
return [volume,top,bottom]
geom = pygmsh.built_in.Geometry()
-snip-
vol_0,_,_ = generate_box(geom, 0.0, h0, w0)
geom.add_physical(vol_0, label=0)
vol_1,_,_ = generate_box(geom, h0, h1, w0)
geom.add_physical(vol_1, label=1)
-snip-
msh = pygmsh.generate_mesh(geom)
This creates 3D box:es (which I can view in Paraview if I use meshio to write a vtk-file to disk, for example).
How do I make FEniCS understand the mesh with domain/subdomains and how do I set the subdomain properties?