How to define BCs on boundaries of submeshes of a parent mesh?

Hi,

sorry, i should have been more clear in my code, i just copied it out of my project.

  • mesh_Subdomain is a MeshView object created via MeshView.create(subdomain, idx) as here: Assigning one VectorFunctionSpace to multiple submeshes - #2 by Emanuel_Gebauer

  • indices is a list of numbers to identify the subdomain for which you want to get your factet/cell meshfunction.
    So let’s say you want have a meshFunction (let’s call it mf_2d_subdomain) for your subdomain, which is marked in your original mesh/MeshFunction (called md) with a 1.
    In order to get the mesh from your subdomain you’d write:

mesh_subdomain = Meshview.create(md, 1)

This creates a submesh for your subdomain. The code in Assigning one VectorFunctionSpace to multiple submeshes - #2 by Emanuel_Gebauer only extens this so that you can define your subdomain by a list of numbers.
Then you would want to get your meshfunction for your subdomain. For this you would use the above code and write:

submesh_mf, submesh_md = extract_SubMesh_FacetDomain(mesh, mesh_subdomain, md, mf, [1])

Here I replaced in my code with mf_2d with md and mf_1d with mf.

Hope this helps for you :slight_smile:

1 Like