Skip to content

Commit

Permalink
update bieapply test format
Browse files Browse the repository at this point in the history
  • Loading branch information
tristangdwl committed Apr 4, 2024
1 parent 712eb21 commit ee97ee4
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 10 deletions.
2 changes: 0 additions & 2 deletions chunkie/+chnk/+flam/proxyfunr.m
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,7 @@
if (size(rslf,1) == 2)
srcinfo.n = chnk.perp(ptau);
targinfo.n = chnk.perp(dslf);
if isnan(sum(targinfo.n,'all')), sum(targinfo.n,'all'), end
end
if isnan(sum(targinfo.r,'all')), sum(targinfo.r,'all'), end
Kpxy = kern(srcinfo,targinfo);

Kpxy = Kpxy(islfuni2,:);
Expand Down
12 changes: 6 additions & 6 deletions devtools/test/bieapplyTest.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
seed = 8675309;
rng(seed);

%% chunker geometry parameters and construction
% chunker geometry parameters and construction

cparams = [];
cparams.eps = 1.0e-4;
Expand All @@ -19,7 +19,7 @@
amp = 0.5;
chnkr = chunkerfunc(@(t) starfish(t,narms,amp),cparams);

%% scalar chunker test
% scalar chunker test
fkern = kernel('lap','d');

start = tic; sysmat = chunkermat(chnkr,fkern); t1 = toc(start);
Expand Down Expand Up @@ -54,7 +54,7 @@
fprintf('relative solve error %5.2e\n',relerr);
assert(relerr < 1e-13)

%% vector valued chunker test
% vector valued chunker test
nregions = 2;
ks = [1.1;2.1]*30;
coefs = [1.0;1.0];
Expand Down Expand Up @@ -104,7 +104,7 @@
assert(relerr < 1e-10)


%% setup chunkgraph
% setup chunkgraph

nverts = 3;
verts = exp(1i*2*pi*(0:(nverts-1))/nverts);
Expand Down Expand Up @@ -133,7 +133,7 @@
rgns = findregions(cgrph);
cgrph = balance(cgrph);

%% scalar chunkgraph test
% scalar chunkgraph test
fkern = -2*kernel('lap','d');

start = tic; sysmat = chunkermat(cgrph,fkern); t1 = toc(start);
Expand Down Expand Up @@ -167,7 +167,7 @@
fprintf('relative solve error %5.2e\n',relerr);
assert(relerr < 1e-13)

%% vectorvalued chunkgraph test
% vectorvalued chunkgraph test
nregions = 2;
ks = [1.1;2.1]*30;
coefs = [1.0;1.0];
Expand Down
20 changes: 18 additions & 2 deletions devtools/test/chunkerintegralTest.m
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,22 @@
chnkr = chunkerfunc(@(t) starfish(t,narms,amp),cparams);


% build helmholtz dirichlet matrix
% scalar function on boundary

fkern = @(s,t) chnk.helm2d.kern(zk,s,t,'D');
fscal = @(xx) cos(xx(1,:)-1.0) + sin(xx(2,:)-0.5);
fvals = fscal(reshape(chnkr.r,2,chnkr.k*chnkr.nch));
opts = [];
opts.quadgkparams = {'RelTol',1e-15};
opts.usesmooth = false;
fscal_int1 = chunkerintegral(chnkr,fvals,opts);
opts.usesmooth = true;
fscal_int3 = chunkerintegral(chnkr,fvals,opts);

opts.usesmooth = false;
fscal_int2 = chunkerintegral(chnkr,fscal,opts);
opts.usesmooth = true;
fscal_int4 = chunkerintegral(chnkr,fscal,opts);

assert(abs(fscal_int1-fscal_int2)/abs(fscal_int2) < 1e-9);
assert(abs(fscal_int3-fscal_int2)/abs(fscal_int2) < 1e-9);
assert(abs(fscal_int4-fscal_int2)/abs(fscal_int2) < 1e-9);

0 comments on commit ee97ee4

Please sign in to comment.