# Resonance with square scatterer

Edited: I am very new to NGSolve. I’m trying to verify some resonance values that I’ve solved for through collocation methods on the integral equation form for the 2D Helmholtz equation with constant value scatterer, the scatterer has value 3, so the equation looks like
$$\Delta u + 3 \lambda u =0$$

I’m using the tutorial as well as things I’ve seen on other posts and have the following code:

[code]geo = SplineGeometry()

Points = [(0,0), (1,0), (1,1), (0,1)]
for pnt in Points:
for pids in [[0,1],[1,2],[2,3], [3,0]]:
geo.Append([“line”]+pids,leftdomain=1,rightdomain=2,bc=“scat”)

geo.AddCircle( (0.5,0.5), 1.0, leftdomain=2, rightdomain=3, bc=“innerbdn”)

geo.SetMaterial(1, “inner”)
geo.SetMaterial(2, “air”)
geo.SetMaterial(3, “pmlregion”)
mesh = Mesh(geo.GenerateMesh(maxh=0.1))
mesh.Curve(3)

omega_0 = 1
omega_tilde = 3

domain_values = {‘inner’: omega_tilde,‘air’: omega_0, ‘pmlregion’: omega_0}
values_list = [domain_values[mat] for mat in mesh.GetMaterials()]
omega = CoefficientFunction(values_list)

Draw(omega, mesh, ‘piecewise’)

fes = H1(mesh, order=4, complex=True, dirichlet=“dir”)

u = fes.TrialFunction()
v = fes.TestFunction()

a = BilinearForm (fes, symmetric=True)

m = BilinearForm (fes, symmetric=True)
m += uvdx

a.Assemble()
m.Assemble()
u = GridFunction(fes, multidim=50, name=‘resonances’)