From f4fe61a6578aa1eb3628eab0864f62ff2e417c1e Mon Sep 17 00:00:00 2001 From: Travis Askham Date: Thu, 4 Apr 2024 15:09:36 -0400 Subject: [PATCH] fix .h bug in chunkerinterior for axissym, add test of chunkerinterior --- chunkie/chunkerinterior.m | 1 - devtools/test/chunkerinteriorTest.m | 10 ++++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/chunkie/chunkerinterior.m b/chunkie/chunkerinterior.m index 4a23291..f0c29fe 100644 --- a/chunkie/chunkerinterior.m +++ b/chunkie/chunkerinterior.m @@ -99,7 +99,6 @@ chnkr.d2(:,:,istart:iend) = fliplr(chnkr.d2(:,:,1:nch)); chnkr.d2(1,:,istart:iend) = chnkr.d2(1,:,istart:iend); - chnkr.h(istart:iend) = chnkr.h(1:nch); chnkr.wts = weights(chnkr); chnkr.n = normals(chnkr); chnkr.adj(1,:) = 0:chnkr.nch-1; diff --git a/devtools/test/chunkerinteriorTest.m b/devtools/test/chunkerinteriorTest.m index 2538be6..281d205 100644 --- a/devtools/test/chunkerinteriorTest.m +++ b/devtools/test/chunkerinteriorTest.m @@ -82,5 +82,11 @@ fprintf('%5.2e s : time for chunkerinterior (chunker, with fmm)\n',t5); assert(all(in5(:) == 1)); - - +% test axissym option +chnkr = chunkerfunc(@(t) starfish(t),struct('ta',-pi/2,'tb',pi/2,'ifclosed',0)); +nt = 1000; +ttarg = -pi/2+pi*rand(nt,1); scal = 2*rand(1,nt); +targs = starfish(ttarg).*scal; + +in = chunkerinterior(chnkr,targs,struct('axissym',true)); +assert(all(in(:) == (scal(:) <= 1))); \ No newline at end of file