2 radiator = quad2tria(create_sphere_boundary(1, 5));
4 field = revolve_mesh(create_line([1.125, 0, 0; 3.625, 0, 0], 40), pi/100, 50, [0 0 1]);
7 [r_nodes, r_elem] = extract_core_mesh(radiator);
8 [f_nodes, f_elem] = extract_core_mesh(field);
12 [Ms, Mf] = helmholtz_bem_indirect_dirichlet(r_nodes, r_elem, f_nodes, f_elem, k);
16 [r_cent, r_norm] = centnorm(radiator);
17 [ps_ana, qs_ana] = incident(
'point', x0, r_cent, r_norm, k);
20 f_cent = centnorm(field);
21 pf_ana = incident(
'point', x0, f_cent, [], k);
24 sigma_inf = Ms \ ps_ana;
25 pf_num = Mf * sigma_inf;
28 pf_err = abs(pf_num./pf_ana - 1);
33 plot_mesh(field, real(pf_num)); view(2); shading flat;
34 c1 = colorbar(
'SouthOutside');
35 xlabel(c1,
'Real part of numerical solution');
37 plot_mesh(field, log10(pf_err)); view(2); shading flat;
38 c1 = colorbar(
'SouthOutside');
39 xlabel(c1,
'Log10 error');
42 fprintf(
'Field log10 error: %f \n', log10(mean(pf_err)));