diff --git a/chunkie/+chnk/+axissymhelm2d/asym_helm_data.mat b/chunkie/+chnk/+axissymhelm2d/asym_helm_data.mat new file mode 100644 index 0000000..cebb0a8 Binary files /dev/null and b/chunkie/+chnk/+axissymhelm2d/asym_helm_data.mat differ diff --git a/chunkie/+chnk/+axissymhelm2d/helm_axi_close_table_old.m b/chunkie/+chnk/+axissymhelm2d/helm_axi_close_table_old.m deleted file mode 100644 index c82ea3a..0000000 --- a/chunkie/+chnk/+axissymhelm2d/helm_axi_close_table_old.m +++ /dev/null @@ -1,76 +0,0 @@ -function [kerns,kernsdk,kernsda,kernsdkk,kernsdak,kernsdaa] ... - = helm_axi_close_table(r0s,alphs,ifun,htables) - int = zeros(size(alphs)); - kerns = int; - kernsdk = int; - kernsda = int; - kernsdkk= int; - kernsdak= int; - kernsdaa= int; - - for ii=1:numel(alphs) - - alph = alphs(ii); - r0 = r0s(ii); - - - ik = ceil(r0/(pi)); - ia = ceil(-log(alph*5)/log(2)); - - if (ia >111 || ik >152) - kern = 0; - kernda = 0; - kerndk = 0; - kerndak = 0; - kerndkk = 0; - kerndaa = 0; - else - krel = (r0-pi*(ik-1))*2/pi-1; - arel = ((alph - 0.2*2^(-ia))/(0.2*2^(-ia))-0.5)*2; - - tas = cos((0:(htables.ncheb-1))*acos(arel)); - tks = cos((0:(htables.ncheb-1))*acos(krel)); - - %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - vv = squeeze(htables.allvs(:,:,ifun,ia,ik)); - kern = tas*vv*tks.'; - - %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - vdk = squeeze(htables.alldk(:,:,ifun,ia,ik)); - kerndk = tas*vdk*tks.'; - - %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - vda = squeeze(htables.allda(:,:,ifun,ia,ik)); - kernda = tas*vda*tks.'; - - %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - vdak = squeeze(htables.alldak(:,:,ifun,ia,ik)); - kerndak = tas*vdak*tks.'; - - %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - vdkk = squeeze(htables.alldkk(:,:,ifun,ia,ik)); - kerndkk = tas*vdkk*tks.'; - - %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - vdaa = squeeze(htables.alldaa(:,:,ifun,ia,ik)); - kerndaa = tas*vdaa*tks.'; - - end - kerns(ii) = kern; - kernsdk(ii) = kerndk; - kernsda(ii) = kernda; - kernsdaa(ii)= kerndaa; - kernsdak(ii)= kerndak; - kernsdkk(ii)= kerndkk; - - end - - -end - diff --git a/chunkie/+chnk/+axissymhelm2d/load_asym_tables.m b/chunkie/+chnk/+axissymhelm2d/load_asym_tables.m index 83c2218..6e5664d 100644 --- a/chunkie/+chnk/+axissymhelm2d/load_asym_tables.m +++ b/chunkie/+chnk/+axissymhelm2d/load_asym_tables.m @@ -1,22 +1,8 @@ function asym_tables = load_asym_tables() %CHNK.AXISSYMHELM2D.load_asym_tables loads the precomputed tables % for axissymmetric Helmholtz kernels - - dirname = '+chnk/+axissymhelm2d/'; - vdats = {}; - nks = 152; - for ii=1:nks - load([dirname 'k2test',num2str(ii),'.mat']); - v = Expression1; - v = reshape(v,[12,12,3,111]); - vdats{ii} = v; - end - - allvs = zeros([size(vdats{1}),nks]); - - for ii=1:nks - allvs(:,:,:,:,ii) = vdats{ii}; - end + + load('asym_helm_data.mat','allvs'); ncheb = 12; xcheb = (0:(ncheb-1))/(ncheb-1)*pi; diff --git a/chunkie/+chnk/+axissymhelm2d/load_asym_tables_old.m b/chunkie/+chnk/+axissymhelm2d/load_asym_tables_old.m deleted file mode 100644 index 83c2218..0000000 --- a/chunkie/+chnk/+axissymhelm2d/load_asym_tables_old.m +++ /dev/null @@ -1,103 +0,0 @@ -function asym_tables = load_asym_tables() -%CHNK.AXISSYMHELM2D.load_asym_tables loads the precomputed tables -% for axissymmetric Helmholtz kernels - - dirname = '+chnk/+axissymhelm2d/'; - vdats = {}; - nks = 152; - for ii=1:nks - load([dirname 'k2test',num2str(ii),'.mat']); - v = Expression1; - v = reshape(v,[12,12,3,111]); - vdats{ii} = v; - end - - allvs = zeros([size(vdats{1}),nks]); - - for ii=1:nks - allvs(:,:,:,:,ii) = vdats{ii}; - end - ncheb = 12; - xcheb = (0:(ncheb-1))/(ncheb-1)*pi; - - [N,X]=meshgrid(0:(ncheb-1),xcheb); - Tc2v = cos(N.*X); - Tv2c = inv(Tc2v); - Tfull = kron(Tv2c,Tv2c); - Tc2vd = N.*sin(N.*X)./sqrt(1-cos(X).^2); - Tc2vd(1,:) = (0:(ncheb-1)).^2; - Tc2vd(end,:) = (-1).^(1:ncheb).*(0:(ncheb-1)).^2; - Tc2cd = Tv2c*Tc2vd; - - xcheb = cos(xcheb)'; - - - allda = allvs; - alldk = allvs; - alldaa= allvs; - alldak= allvs; - alldkk= allvs; - - for kk=1:nks - for jj=1:111 - for ii=1:3 -% vmat = squeeze(allvs(:,:,ii,jj,kk)); - if (ii ==1) - vmat = squeeze(allvs(:,:,ii,jj,kk)); - else - vmat = squeeze(allvs(:,:,ii,jj,kk)); - vmat = reshape(Tfull*vmat(:),[12,12]); - allvs(:,:,ii,jj,kk) = vmat; - end - ia = jj; - vda = (2)^(ia-1)*20*Tc2cd*vmat; - vdaa= (2)^(ia-1)*20*Tc2cd*vda; - vdk = 2/(pi)*Tc2cd*vmat.'; - vdkk= (2)/pi*Tc2cd*vdk; - vdak = 2/(pi)*Tc2cd*vda.'; - allda(:,:,ii,jj,kk) = vda; - alldaa(:,:,ii,jj,kk)= vdaa; - alldk(:,:,ii,jj,kk) = vdk.'; - alldak(:,:,ii,jj,kk)= vdak.'; - alldkk(:,:,ii,jj,kk)= vdkk.'; - end - end - end - - asym_tables =[]; - asym_tables.allvs = allvs; - asym_tables.allda = allda; - asym_tables.alldaa= alldaa; - asym_tables.alldk = alldk; - asym_tables.alldak= alldak; - asym_tables.alldkk= alldkk; - asym_tables.ncheb = ncheb; - - nlege = 500; - [xlege,wlege,~,~] = lege.exps(nlege); - xlege = (pi*(xlege+1)/2); - wlege = wlege*pi/2; - asym_tables.xlege = xlege; - asym_tables.wlege = wlege; - - nlege = 100; - [xlege,wlege,~,~] = lege.exps(nlege); - xlege = (pi*(xlege+1)/2); - wlege = wlege*pi/2; - asym_tables.xlege_mid = xlege; - asym_tables.wlege_mid = wlege; - - nlege = 50; - [xlege,wlege,~,~] = lege.exps(nlege); - xlege = (pi*(xlege+1)/2); - wlege = wlege*pi/2; - asym_tables.xlege_midnear = xlege; - asym_tables.wlege_midnear = wlege; - - nlege = 20; - [xlege,wlege,~,~] = lege.exps(nlege); - xlege = (pi*(xlege+1)/2); - wlege = wlege*pi/2; - asym_tables.xlege_midnearnear = xlege; - asym_tables.wlege_midnearnear = wlege; -end