Integrating over an interior surface

From UFL manual ds represents exterior facet integral (that is why your code works for boundary surface). For interior surface dS is needed

assemble(avg(g)*dS(subdomain_id=1, subdomain_data=interior_surface_marker))

2 Likes