10 mesh = create_radiatterer(Le);
11 % mesh = create_brick_boundary(L, M);
12 nElem = size(mesh.Elements,1);
14 %% Create field point mesh
15 [xc, nc] = geo2gauss(mesh, 2);
19 field = create_empty_mesh();
21 field.Nodes = [(1 : Nf)' xc + eps * nc];
22 field.Elements(1:Nf,1) = 1:Nf;
23 field.Elements(:,2) = ShapeSet.LinearQuad.Id;
24 field.Elements(:,3) = 1;
25 field.Elements(:,4) = 1;
26 field.Elements(:,5:8) = repmat(field.Nodes(:,1), 1, 4);
32 kmax = min(mesh_kmax(mesh));
35 %% Compute BEM matrices
36 [surf_nodes, surf_elements] = extract_core_mesh(mesh);
37 [field_nodes, field_elements] = extract_core_mesh(field);
39 [G, H, Ht, D, Gf, Hf] = helmholtz_bem_3d_matrices_gauss(...
40 surf_nodes, surf_elements, field_nodes, field_elements, k);
44 % [p0, q0] = incident(
'point', x0, xc, nc, k);
52 ps = gmres(A, rhs, 100, 1e-4, 100);
55 plot_mesh(mesh, abs(mean(reshape(ps, 4, []), 1)
'));
63 rhs = ((G + alpha * (Ht + .5 * I)) * q0);
64 A = ((H - .5 * I) + alpha * D);
65 ps_bm = gmres(A, rhs, 100, 1e-4, 100);
68 plot_mesh(mesh, abs(mean(reshape(ps_bm, 4, []), 1)'));
72 title(
'Burton-Miller');
75 Ht_appr = (Gf - G) / eps;
76 D_appr = (Hf -
H) / eps;
79 Ht_appr(idx,idx) = Ht(idx,idx);
80 D_appr(idx,idx) = D(idx,idx);
83 rhs = ((G + alpha * (Ht_appr + .5 * I)) * q0);
84 A = ((
H - .5 * I) + alpha * D_appr);
85 ps_bm_appr = gmres(A, rhs, 100, 1e-4, 100);
88 plot_mesh(mesh, abs(mean(reshape(ps_bm_appr, 4, []), 1)
'));
92 title('Burton-Miller approx
');
95 rhs = (Ht + .5 * I) * q0;
97 ps_2 = gmres(A, rhs, 100, 1e-4, 100);
100 plot_mesh(mesh, abs(mean(reshape(ps_2, 4, []), 1)'));