From 7338bc1e6bcaa31f7a136c190334827a011a9a62 Mon Sep 17 00:00:00 2001 From: treecity Date: Sat, 22 Oct 2011 21:51:50 +0000 Subject: [PATCH] =?utf8?q?[src]=20Autoskripte=20k=C3=B6nnen=20nun=20versch?= =?utf8?q?iedene=20Typen=20testen=20und=20auch=20dazu=20die=20mu?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit git-svn-id: https://drops.fb12.tu-berlin.de/svn/bacc/trunk@61 26120e32-c555-405d-b3e1-1f783fb42516 --- src/A_AnIso.m | 8 +++++++- src/A_Iso.m | 9 ++++++++- src/A_stepAnIso.m | 38 +++++++++++++++++++++++++++----------- src/A_stepIso.m | 21 ++++++++++++++++----- 4 files changed, 58 insertions(+), 18 deletions(-) diff --git a/src/A_AnIso.m b/src/A_AnIso.m index 4fc8049..56483be 100644 --- a/src/A_AnIso.m +++ b/src/A_AnIso.m @@ -7,6 +7,11 @@ A_loadMeshF(file) global G_Ta; global G_Da; +if(length(mu)~=length(type)&&length(mu)~=1) + disp 'Error: Pleas set right type and mu parameters' + return +end + for i = 1:times if(size(G_Ta,1)>2) nextF = G_Ta(end,1)*4; @@ -22,8 +27,9 @@ for i = 1:times A_stepAnIso(mu,type,eta,eps); usedTime = G_Ta(end,:) data = G_Da(end,:) + typeN = int2str(type); - A_saveMesh(['anIso' int2str(type) '_' int2str(size(G_Ta,1))]); + A_saveMesh(['anIso' typeN(typeN~=' ') '_' int2str(size(G_Ta,1))]); end diff --git a/src/A_Iso.m b/src/A_Iso.m index 2385163..4d02c1a 100644 --- a/src/A_Iso.m +++ b/src/A_Iso.m @@ -7,6 +7,11 @@ A_loadMeshF(file) global G_Ti; global G_Di; +if(length(mu)~=length(type)&&length(mu)~=1) + disp 'Error: Pleas set right type and mu parameters' + return +end + for i = 1:times if(size(G_Ti,1)>2) nextF = G_Ti(end,1)*4; @@ -21,8 +26,10 @@ for i = 1:times A_stepIso(mu,type); usedTime = G_Ti(end,:) DiTi = G_Di(end,:) + + typeN = int2str(type); - A_saveMesh(['Iso' int2str(type) '_' int2str(size(G_Ti,1))]); + A_saveMesh(['Iso' typeN(typeN~=' ') '_' int2str(size(G_Ti,1))]); end diff --git a/src/A_stepAnIso.m b/src/A_stepAnIso.m index 8286ec4..5001ca4 100644 --- a/src/A_stepAnIso.m +++ b/src/A_stepAnIso.m @@ -13,29 +13,45 @@ if (isempty(G_E) || isempty(G_C) || isempty(G_N)) return end +if(length(mu)~=length(type)&&length(mu)~=1) + disp 'Error: Pleas set right type and mu parameters' + return +end +if(length(mu)==1) + mu = repmat(mu,length(type),1); +end + time = zeros(1,3); tic [coordinates_fine,elements_fine,neigh_fine,f2s]=refineQuad(G_C,G_E,G_N,2); time(1) = toc; - - tic - A_fine = mex_build_AU(coordinates_fine,elements_fine,mu,type); - time(2) = toc; - - b = sqrt(sum(quadNorm(coordinates_fine,elements_fine,'w').^2,2)); + - x_fine = A_fine\b; - xe_fine = x_fine'*A_fine*x_fine; + tic + dataAniso = size(G_E,1); + for i = 1:length(type) + A_fine = mex_build_AU(coordinates_fine,elements_fine,mu(i),type(i)); + + b = sqrt(sum(quadNorm(coordinates_fine,elements_fine,'w').^2,2)); + + x_fine = A_fine\b; + + xe_fine = x_fine'*A_fine*x_fine; + + ind = computeEstSlpMuTilde(x_fine,G_C,G_E,f2s); - ind = computeEstSlpMuTilde(x_fine,G_C,G_E,f2s); + dataAniso = [dataAniso type sqrt(sum(ind)) xe_fine]; + end + time(2) = toc; + marked = mark(x_fine(f2s)',ind,eta,eps); % clear 'coordinates_fine' 'elements_fine' 'neigh_fine' 'f2s' - dataAniso = [size(G_E,1) sqrt(sum(ind)) xe_fine]; + if(size(G_E,1)~=length(marked)) disp 'Error: MarkierungsVektor ist fehlerhaft' @@ -52,7 +68,7 @@ time = zeros(1,3); G_Ta(size(G_Ta,1)+1,1:4) = [size(G_E,1) time]; - G_Da(size(G_Da,1)+1,1:3) = dataAniso; + G_Da(size(G_Da,1)+1,1:length(dataAniso)) = dataAniso; % plotShape(G_C,G_E,''); diff --git a/src/A_stepIso.m b/src/A_stepIso.m index 0eea0b8..b0f1233 100644 --- a/src/A_stepIso.m +++ b/src/A_stepIso.m @@ -11,6 +11,14 @@ if (isempty(G_E) || isempty(G_C)) return end +if(length(mu)~=length(type)&&length(mu)~=1) + disp 'Error: Pleas set right type and mu parameters' + return +end +if(length(mu)==1) + mu = repmat(mu,length(type),1); +end + time = zeros(1,2); tic @@ -18,9 +26,10 @@ time = zeros(1,2); time(1) = toc; tic - A_fine = mex_build_AU(coordinates_fine,elements_fine,mu,type); - time(2) = toc; - + dataIso = size(G_E,1); + for i = type + A_fine = mex_build_AU(coordinates_fine,elements_fine,mu(i),type(i)); + b = sqrt(sum(quadNorm(coordinates_fine,elements_fine,'w').^2,2)); x_fine = A_fine\b; @@ -29,7 +38,9 @@ time = zeros(1,2); ind = computeEstSlpMuTilde(x_fine,G_C,G_E,f2s); - dataIso = [size(G_E,1) sqrt(sum(ind)) xe_fine]; + dataIso = [dataIso type sqrt(sum(ind)) xe_fine]; + end + time(2) = toc; G_C = coordinates_fine; G_E = elements_fine; G_N = neigh_fine; @@ -40,7 +51,7 @@ time = zeros(1,2); G_Ti(size(G_Ti,1)+1,1:3) = [size(G_E,1) time]; - G_Di(size(G_Di,1)+1,1:3) = dataIso; + G_Di(size(G_Di,1)+1,1:length(dataIso)) = dataIso; end -- 2.47.3