Skip to content

Commit 4050b3d

Browse files
committed
revert pquadtest
1 parent 43bad3c commit 4050b3d

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

devtools/test/pquadTest.m

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,19 @@
77

88
zk = norm(kvec);
99

10-
cparams = []; cparams.maxchunklen = 2.0/real(zk);
10+
% define geometry and boundary conditions
11+
% (vertices defined by another function)
12+
13+
cparams = []; cparams.eps = 1e-9;
1114
chnkr = chunkerfunc(@(t) starfish(t),cparams);
15+
chnkr = refine(chnkr,struct('nover',1));
1216

1317
% solve and visualize the solution
1418

1519
% build laplace dirichlet matrix
1620

1721
% fkern = kernel('laplace','d');
18-
fkern = kernel('helmholtz','c',zk,[1,-2i]);
22+
fkern = kernel('helmholtz','c',zk,[1.5,-2i]);
1923
opts = [];
2024
start = tic; C = chunkermat(chnkr,fkern,opts);
2125
t1 = toc(start);
@@ -27,7 +31,7 @@
2731
sys = -0.5*eye(chnkr.npt) + C;
2832

2933
% rhs = chnkr.data(1,:); rhs = rhs(:);
30-
rhs = besselh(0,zk*abs((2+2.25*1i)-(chnkr.r(1,:)+1i*chnkr.r(2,:)))); rhs = rhs(:);
34+
rhs = besselh(0,zk*abs((1+1.25*1i)-(chnkr.r(1,:)+1i*chnkr.r(2,:)))); rhs = rhs(:);
3135
start = tic; sol = gmres(sys,rhs,[],1e-14,100); t1 = toc(start);
3236

3337
fprintf('%5.2e s : time for dense gmres\n',t1)
@@ -61,16 +65,14 @@
6165
t1 = toc(start);
6266
fprintf('%5.2e s : time for kerneval (Helsing-Ojala for near)\n',t1);
6367

64-
soltrue = besselh(0,zk*abs((2+2.25*1i)-(targets(1,in)+1i*targets(2,in))));
65-
6668
start = tic;
6769
Csol = chunkerkerneval(chnkr,fkern,sol,targets(:,in)); t1 = toc(start);
6870
fprintf('%5.2e s : time for kerneval (adaptive for near)\n',t1);
6971

7072
% Compare with reference solution Dsol
71-
err = max(abs(Csol-Csolpquad))/max(abs(Csol));
72-
err2 = max(abs(soltrue(:)-Csolpquad(:)))/max(abs(soltrue(:)));
73-
fprintf('%5.2e : Relative max error\n',err);
73+
rel_error = max(abs(Csol-Csolpquad))/max(abs(Csol));
74+
fprintf('%5.2e : Relative max error\n',rel_error);
7475
%
7576

76-
assert(err < 1e-10)
77+
assert(rel_error < 1e-10)
78+
% profile viewer

0 commit comments

Comments
 (0)