I would like to solve a scattering problem in 2D. The scatterer is a subdomain for example:

def square(hmax=0.1,pml_rad=2,delta_pml=1):

geo = SplineGeometry()

L2=.5

geo.AddRectangle(p1=(-L2,-L2),p2=(L2,L2),bc=“trans”,leftdomain=3,rightdomain=1)

geo.AddCircle( (0,0),pml_rad+delta_pml , leftdomain=2, rightdomain=0, bc=“outerbnd”)

geo.AddCircle( (0,0), pml_rad, leftdomain=1, rightdomain=2)

geo.SetMaterial(1, “air”)

geo.SetMaterial(2, “PML”)

geo.SetMaterial(3, “scatterer”)

mesh = Mesh(geo.GenerateMesh(maxh=hmax))

return(mesh,pml_rad,ngmesh)

I get the normal via

nv=specialcf.normal(mesh.dim)

Is there some way to test that the normal in nv is outwards from the scatterer (so I can set transmission conditions), and reverse the normal if needed?

Thanks in advance for your help.

Best

Peter