From: treecity Date: Fri, 27 Jan 2012 13:20:47 +0000 (+0000) Subject: [src] fineMesh + A und x werden auch gespeichert too X-Git-Url: https://git.leopard-lacewing.eu/?a=commitdiff_plain;h=a32ea72515969cc165cd2026c6d5dc46daaa4d77;p=bacc.git [src] fineMesh + A und x werden auch gespeichert too git-svn-id: https://drops.fb12.tu-berlin.de/svn/bacc/trunk@85 26120e32-c555-405d-b3e1-1f783fb42516 --- diff --git a/src/A_plots.m b/src/A_plots.m index 8d15a19..47d4843 100644 --- a/src/A_plots.m +++ b/src/A_plots.m @@ -57,8 +57,9 @@ if step<1 disp ('Error: No Data to show.') else G_D - sol = neville2(1./X(round(1):end,3)',G_D(round(1):end,3)',0); - sol = 8.28466; + + sol = interp1(1./X(round(1):31,6)',G_D(round(1):31,6)',0,'spline') +% sol = 8.28466; figure(4) loglog(X(:,[2+(0:step-1)*3]),G_D(:,[2+(0:step-1)*3]),'--o') diff --git a/src/A_run.m b/src/A_run.m index 316697f..216084e 100644 --- a/src/A_run.m +++ b/src/A_run.m @@ -14,10 +14,8 @@ A_loadMeshF(file) global G_T; global G_D; -if(length(mu)~=max(type)-1&&length(mu)~=1) - disp 'Error: Pleas set right type and mu parameters' - return -end +assert(length(mu)==max(type)-1||length(mu)==1,... + 'Pleas set right type and mu parameters'); for i = 1:times if(size(G_T,1)>2) @@ -32,7 +30,7 @@ for i = 1:times %overFlowTime = neville2(G_T(size(G_T,1)+(-1:0),1)',sum(G_T(size(G_T,1)+(-1:0),2:4),2)',4500) end - A_step(mu,type,eta,eps); + A_step(mu,type,eta,eps,out); usedTime = G_T(end,:) data = G_D(end,:) typeN = int2str(type); diff --git a/src/A_step.m b/src/A_step.m index 24d972d..c5ddacd 100644 --- a/src/A_step.m +++ b/src/A_step.m @@ -1,4 +1,4 @@ -function [data time er] = A_step(mu,type,eta,eps) +function [data time er] = A_step(mu,type,eta,eps,varargin) % [dataAniso time er] = A_stepAnIso(mu,type,eta,eps) global G_E; @@ -17,6 +17,11 @@ if(length(mu)==1) mu = repmat(mu,max(type)-1,1); end +out = ''; +if(lenght(varargin)~=0) + out = varargin{1}; +end + time = zeros(1,3); tic [coordinates_fine,elements_fine,neigh_fine,f2s]=refineQuad(G_C,G_E,G_N,2); @@ -26,6 +31,8 @@ time = zeros(1,3); tic data = size(G_E,1); + save_A = {}; + save_x = {}; for i = 1:length(type) A_fine = mex_build_AU(coordinates_fine,elements_fine,mu,type(i)); @@ -36,12 +43,17 @@ time = zeros(1,3); plotMark([r';c'],coordinates_fine,elements_fine) title('Fehlerhafte Elemente') end + + x_fine = A_fine\b; xe_fine = x_fine'*A_fine*x_fine; ind = computeEstSlpMuTilde(x_fine,G_C,G_E,f2s); + + save_A{i} = A_fine; + save_x{i} = x_fine; data = [data type(i) sqrt(sum(ind)) xe_fine]; end @@ -61,6 +73,7 @@ time = zeros(1,3); view(2) plotMark(find(marked>1),G_C,G_E); + % clear 'coordinates_fine' 'elements_fine' 'neigh_fine' 'f2s' @@ -81,6 +94,11 @@ time = zeros(1,3); G_T(size(G_T,1)+1,1:4) = [size(G_E,1) time]; G_D(size(G_D,1)+1,1:length(data)) = data; + +% A_saveMesh([out typeN(typeN~=' ') '_' int2str(size(G_T,1))]); + typeN = int2str(type); + save (['meshSave/''fine' out typeN(typeN~=' ') '_' int2str(size(G_T,1))],... + 'coordinates_fine', 'elements_fine','neigh_fine','f2s','time','data','save_A','save_x') % plotShape(G_C,G_E,'');