fenics-adapter
fenics-adapter copied to clipboard
Support multiple Neumann boundary conditions per domain and provide a tutorial on this feature
Our adapter only supports a single Neumann boundary condition on the whole domain (see FEniCS tutorial book, p.85). We add g*ds
in the weak form to implement Neumann boundary conditions.
To be able to support multiple Neumann boundary conditions (for example, one coupling boundary condition and one on the original boundary), we have to use markers to restrict the boundary integral to the respective subdomain. Pseudocode:
coupling_domain.mark(boundary_markers, 1)
F += g*ds(1)
For more information see FEniCS tutorial book, section 4.4
This feature is (at least partially) implemented in the current version of the adapter:
https://github.com/precice/fenics-adapter/blob/1ccab476e3923b34daf274e365ad777f9411569f/fenicsadapter/fenicsadapter.py#L514-L529
However, I think we should also have an example, where one can see how to apply this feature. Something similar to ~~https://fenicsproject.org/docs/dolfin/1.6.0/python/demo/documented/subdomains-poisson/python/documentation.html~~ (link is broken, see below) would be nice.
I just discovered that the link provided above seems to be broken. What I was referring to is the example in chapter 4.3 "Defining subdomains for different materials" in the FEniCS tutorials book.
The FEniCS-X version of this tutorial is provided at https://jorgensd.github.io/dolfinx-tutorial/chapter3/subdomains.html.
I'm not sure if that really belongs here, but it seems somewhat related: Would it be possible to define a coupling boundary from an external mesh, as it is done here? The main problem in more complex geometries is that I can't identify my coupling boundary using coordinates (e.g. x >= 1) but have to use tags (e.g. set it at nodes with tag=1) assigned in my meshing software (I use gmsh).