Problems in space creation from imported grid

Hello,

I am new to bempp. I created a grid (using a convex hull algorthm) outside bempp environment and imported it. grid.plot() looks fine. However, when running A0_int = multitrace_operator(grid, k_int, epsilon_r=epsilon, mu_r=mu_r, space_type=‘all_rwg’) in a Maxwell scattering problem, I get an error:

Exception: Two elements seem to be connected only by a vertex, not by an edge.

It looks like my mesh is wrong, but I cannot get around it. Could someone give hints on how to create a proper grid for bempp from a 3D surface cloud point? Perhaps, appropriate softwares?

Thank you all!

Your mesh seems to have been created incorrectly. The RWG functions for the Maxwell equations are defined on the connecting edge between triangle pairs. Your mesh seems to have corrupt triangles in the mesh, which causes the exception.

You may want to open the mesh file in external software like Gmsh and visually inspect the grid for artifacts, like loose triangles, degenerate elements, duplicated nodes, etc. There are many mesh generation and visualization programs available. The Bempp library takes Gmsh formats as mesh input.