I am having problems assembling an integral over the boundary faces of a mesh. The form of the integral is
$$\int_{\partial \Omega} ((\nabla\times \mathbf{A})\times \mathbf{B})\cdot \mathbf{\hat{n}}\,dS$$
I have tried the following
bmesh = BoundaryMesh(mesh, 'exterior')
facet_domains = FacetFunction('size_t',mesh)
mapping = bmesh.entity_map(2)
boundary_facets = [ Facet(mesh, mapping[cell.index()])
for cell in cells(bmesh) ]
for facet in boundary_facets:
facet_domains[facet] = 42
n = FacetNormal(bmesh)
dsb = Measure('dx', domain=mesh)[facet_domains]
assemble(dot(cross(curl(A),B),n)*dsb,exterior_facet_domain=facet_domains)
I am getting errors like
FLException: An Integral without a Domain is now illegal.
or trying with some minor changes,
UFLException: Integral of type cell cannot contain a FacetNormal.