-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixing chunkerinterior for axissymmetric domains
- Loading branch information
Showing
1 changed file
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
@@ -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 | ||
|
@@ -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; | ||
|
||
|
@@ -59,6 +93,8 @@ | |
end | ||
|
||
|
||
|
||
|
||
icont = false; | ||
if usefmm_final | ||
try | ||
|