Skip to content

Commit

Permalink
fixing chunkerinterior for axissymmetric domains
Browse files Browse the repository at this point in the history
  • Loading branch information
mrachh committed Oct 26, 2023
1 parent 8dc07c4 commit 39529c2
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions chunkie/chunkerinterior.m
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
% opts - options structure with entries:
% opts.fmm = boolean, use FMM
% opts.flam = boolean, use FLAM routines
% opts.axissym = boolean, chunker is axissymmetric
% Note on the default behavior:
% by default it tries to use the fmm if it exists, if it doesn't
% then unless explicitly set to false, it tries to use flam
Expand All @@ -28,6 +29,10 @@

% author: Travis Askham ([email protected])

if class(chnkr) == "chunkgraph"
chnkr = merge(chnkr.echnks);
end

assert(chnkr.dim == 2,'interior only well-defined for 2D');

if nargin < 3
Expand All @@ -44,6 +49,35 @@
useflam = opts.flam;
end

axissym = false;
if isfield(opts,'axissym')
axissym = opts.axissym;
end

if axissym
nch = chnkr.nch;
istart = nch+1;
iend = 2*nch;
chnkr = sort(chnkr);
chnkr = chnkr.addchunk(nch);
chnkr.r(:,:,istart:iend) = fliplr(chnkr.r(:,:,1:nch));
chnkr.r(1,:,istart:iend) = -chnkr.r(1,:,istart:iend);
chnkr.d(:,:,istart:iend) = fliplr(chnkr.d(:,:,1:nch));
chnkr.d(2,:,istart:iend) = -chnkr.d(2,:,istart:iend);

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;
chnkr.adj(2,:) = 2:chnkr.nch+1;
chnkr.adj(1,1) = chnkr.nch;
chnkr.adj(2,chnkr.nch) = 1;
end


usefmm_final = false;
useflam_final = false;

Expand All @@ -59,6 +93,8 @@
end




icont = false;
if usefmm_final
try
Expand Down

0 comments on commit 39529c2

Please sign in to comment.