Skip to content

Commit

Permalink
fix small bugs in demos, medium bug in upsample
Browse files Browse the repository at this point in the history
  • Loading branch information
askhamwhat committed Oct 19, 2023
1 parent 423f2cd commit 482808a
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 11 deletions.
3 changes: 0 additions & 3 deletions chunkie/@chunker/refine.m
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,6 @@

chunklens(i) = sum(chnkr.wts(:,i));
chunklens(nch) = sum(chnkr.wts(:,nch));

chunklens(i) = dot(dsdti,w);
chunklens(nch) = dot(dsdtnch,w);

ifdone=0;

Expand Down
7 changes: 4 additions & 3 deletions chunkie/@chunker/upsample.m
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,11 @@
chnkrup.wts = weights(chnkrup);

if chnkr.hasdata
ndata = chnkr.size(data,1);
ndata = size(chnkr.data,1);
nndata = ndata*nch;
chnkrup.r = permute(reshape(upmat*reshape( ...
permute(chnkr.datastor,[2,1,3]),k,nndata),kup,ndata,nch),[2,1,3]);
chnkrup = chnkrup.makedatarows(ndata);
chnkrup.data = permute(reshape(upmat*reshape( ...
permute(chnkr.data,[2,1,3]),k,nndata),kup,ndata,nch),[2,1,3]);
end

if nargin > 2
Expand Down
2 changes: 1 addition & 1 deletion chunkie/demo/demo_scatter.m
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@

%

start = tic; in = chunkerinterior(chnkr,targets); t1 = toc(start);
start = tic; in = chunkerinterior(chnkr,{xtarg,ytarg}); t1 = toc(start);
out = ~in;

fprintf('%5.2e s : time to find points in domain\n',t1)
Expand Down
8 changes: 4 additions & 4 deletions chunkie/demo/demo_scatter_slit.m
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@

% build CFIE

fkern = @(s,t) chnk.helm2d.kern(zk,s,t,'C',1);
fkern = kernel('helm','C',zk);

start = tic; sysmat = chunkermat(chnkr,fkern);
t1 = toc(start);
Expand All @@ -72,13 +72,13 @@

% get the boundary data for a source located at the point above

kerns = @(s,t) chnk.helm2d.kern(zk,s,t,'s');
kerns = kernel('helm','s',zk);
targs = chnkr.r; targs = reshape(targs,2,chnkr.k*chnkr.nch);
targstau = tangents(chnkr);
targstau = reshape(targstau,2,chnkr.k*chnkr.nch);

srcinfo = []; srcinfo.r = src0; targinfo = []; targinfo.r = targs;
kernmats = kerns(srcinfo,targinfo);
kernmats = kerns.eval(srcinfo,targinfo);
ubdry = -kernmats*strengths;

rhs = ubdry; rhs = rhs(:);
Expand Down Expand Up @@ -115,7 +115,7 @@
fprintf('%5.2e s : time to evaluate kernel\n',t1)

srcinfo = []; srcinfo.r = src0; targinfo = []; targinfo.r = targets(:,out);
uin = kerns(srcinfo,targinfo)*strengths;
uin = kerns.eval(srcinfo,targinfo)*strengths;
utot = uscat(:)+uin(:);

%
Expand Down

0 comments on commit 482808a

Please sign in to comment.