Normals not oriented in Fem-Bem coupling tutorial

Dear Bempp team and community,
(accidentally I deleted my last post when I wanted to add something)
when running the tutorial for the Fem-Bem coupling “Simple FEM-BEM coupling for the Helmholtz equation with FEniCSx” I found that the normals of the cube are not oriented.
To reproduce this issue one can simply enter the command
bempp_space.grid.plot()
or
trace_space.grid.plot()
after running the tutorial script. When showing the normal vectors using e.g. GMSH, one finds that some normals point into the interior and some into the exterior of the cube.
Is this intended or is it not making any difference? In general I would expect the normals to point into the exterior domain.

Best wishes,
Marvin

2 Likes

I found this method to swap normals from an old post. I’m not sure, but I think the orientation of normal vectors and the sign of wave number ‘k’ decide what is considered an outgoing wave. Check the solution with both orientations.

For the BEM to work properly, the unit normal vectors at the surface grid have to be consistent. In most cases, normal vectors vectors are chosen to point outwards. However, Bempp does not check for consistency of the normals. This is the responsibility of the user.

The normal vectors are calculated from the topology of the mesh elements, with the “right-hand rule” for the ordering of the three nodes of each triangular element. The meshes in the shapes module of Bempp use Gmsh to create the surface grid. Indeed, the grid bempp.api.shapes.cube() has all normals pointing outwards.

In the case of the FEM-BEM tutorial, the surface mesh is extracted from the volumetric mesh created by the Dolfin library of FEniCSx. This used to produce a surface mesh with outward pointing normals. However, I tested this with Dolfin’s latest version 0.9.0 and I can reproduce this issue. Half of the normals are pointing outwards and the other half inwards.

Wrongly oriented normals may produce incorrect results, depending on the specific BEM formulation. Since the double-layer operator is used, the results of the FEM-BEM algorithm are wrong with Dolfin 0.9.0.

Workarounds are downgrading the Dolfin version or manually swapping the inward pointing normals.

Thank you very much for your explanation and for checking upon this issue!

I checked it with Dolfin 0.8.0 and it works fine. I created an Issue on GitHub, but have no quick solution for now, other than downgrading Fenics. See Inconsistent normal orientation of Fenics mesh · Issue #223 · bempp/bempp-cl · GitHub.