From ec8c30bdba41d52e663c9063e813fb566b694f42 Mon Sep 17 00:00:00 2001 From: Peter Schaefer Date: Thu, 21 Mar 2013 17:59:58 +0100 Subject: [PATCH] =?utf8?q?[src]=20A=5Fplots=20:=20automatische=20PHI=20Erk?= =?utf8?q?ennung=20aus=20Dateinamen=20[src]=20compute=20:=20steps=20ab=204?= =?utf8?q?0=20sind=20Elementanzahlen=20[src]=20plotShape=20:=20mehr=20flex?= =?utf8?q?ibilit=C3=A4t=20bei=20Beschriftungen=20[src]=20test=5Fsol=20:=20?= =?utf8?q?angepasst=20an=20Element=20anzahlen=20Grenze?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/A_plots.m | 18 +++++++++++++++--- src/compute.m | 10 ++++++++++ src/export_mesh.m | 2 +- src/plotShape.m | 15 ++++++++------- src/test_sol.m | 17 +++++++++-------- 5 files changed, 43 insertions(+), 19 deletions(-) diff --git a/src/A_plots.m b/src/A_plots.m index 9faddea..9609ee2 100644 --- a/src/A_plots.m +++ b/src/A_plots.m @@ -90,9 +90,21 @@ else % data((end-8):end,[1 [3 4 5]]) -% sol = interp1(1./X((round(1)):(end),4)',G_D((round(1)):(end),4)',0,'spline') -% sol = 8.28466; % LShape - sol = 4.609193; % Quad +% sol = interp1(1./X((round(1)):(end),1)',G_D((round(1)):(end),4)',0,'spline') + +% G_D(end,4) + +if(strcmp(t0, '(3DFichCube)')) + sol = 16.2265; %Ferraz-Leite +elseif(strcmp(t0, '(2DQuad)')) + sol = 4.609193; +elseif(strcmp(t0, '(2DLShape)')) + sol = 8.28466; +elseif(strcmp(t0, '(3DCube)')) + sol = 8.303; +elseif(strcmp(t0, '(3DCube3)')) + sol = 1.0379; +end % G_D diff --git a/src/compute.m b/src/compute.m index 343fd55..7cbab1f 100644 --- a/src/compute.m +++ b/src/compute.m @@ -25,6 +25,10 @@ end kap3 = 0; %times mal verfeinern for j = 1:times + %Beende Schleife wenn Element Anzahl erreicht + if(times>40 && size(elements,1) > times) + break; + end if(exist('coo_fine','var')) old_C_fine = coo_fine; old_F_fine = f2s; @@ -32,9 +36,15 @@ for j = 1:times old_x_fine = x_fine; end +% figure(10) +% plotShape(coordinates,elements,''); + %uniformIsotrop Verfeinern [coo_fine,ele_fine,neigh_fine,f2s,sit_fine]... =refineQuad(coordinates,elements,neigh,sites,2); + +% figure(11) +% plotShape(coordinates,elements,''); %Flaecheninhalte Berechnen (rhs) b_fine = areaQuad(sit_fine); diff --git a/src/export_mesh.m b/src/export_mesh.m index 457ab0f..a38a4db 100644 --- a/src/export_mesh.m +++ b/src/export_mesh.m @@ -4,7 +4,7 @@ function export_mesh(coordinates, elements, neigh, f2s, file) % save(file,'coordinates', 'elements','neigh','f2s') %% Übersicht -plotShape(coordinates,elements,'db'); +plotShape(coordinates,elements,'bdt'); if(length(unique(coordinates(:,3)))==1) view(2) diff --git a/src/plotShape.m b/src/plotShape.m index 9cf6331..42ea3ea 100644 --- a/src/plotShape.m +++ b/src/plotShape.m @@ -20,7 +20,7 @@ function plotShape(coordinates, elements, varargin) c = 0; e = 1; n = 0; -t = 0; +t = [0 0]; f = 0; line = 1; optargin = size(varargin,2); @@ -69,13 +69,14 @@ elseif(optargin>=1) end if(ismember('t',varargin{1})) desc = {}; - t = 1; + t(1) = 1; if(optargin==2 && length(varargin{2})>=size(elements,1)) desc = varargin{2}; - end - elseif(ismember('d',varargin{1})) + end + end + if(ismember('d',varargin{1})) desc = {}; - t = 2; + t(2) = 1; end end @@ -140,7 +141,7 @@ if(n) end -if(t==1) +if(t(1)) for idx = eles current = sum(coordinates(elements(idx,[2,4])',:),1)/2; if(e) @@ -157,7 +158,7 @@ if(t==1) end end -if(t>=2) +if(t(2)) for idx = coos current = coordinates(idx,:); if(e) diff --git a/src/test_sol.m b/src/test_sol.m index 598537b..3ac6e88 100644 --- a/src/test_sol.m +++ b/src/test_sol.m @@ -2,35 +2,36 @@ format longG % Matrix MEX Funktion neu Compilieren -mex mex_build_V.cpp slpRectangle.cpp CFLAGS="\$CFLAGS -fopenmp" CXXFLAGS="\$CXXFLAGS -fopenmp" LDFLAGS="\$LDFLAGS -fopenmp" +mex mex_build_V.cpp slpRectangle.cpp CFLAGS="\$CFLAGS -fopenmp" CXXFLAGS="\$CXXFLAGS -fopenmp" LDFLAGS="\$LDFLAGS -fopenmp" % mex mex_build_V.cpp slpRectangle.cpp % Test ausführen -%Anzahl der Schritte -steps = 32; +%Anzahl der Schritte oder wenn groeßer als 30 der Elemente +steps = 500; %Art der Berechnungen -type = [1 3]; +type = [1]; zeta = { [2 2 2] [2 2 2]}; %% Quad adaptiv anisotrop %Datei -file = 'exmpl_2DQuad'; +file = 'exmpl_3DCube'; %Adaptiv -theta = 0.5; +theta = 0.7; %Anisotrop -nu = 0.5; +nu = 0.2; tic [a b fileo]=compute(file, steps, zeta, type, theta, nu, 0); time = toc typeN = int2str(type); +steps = size(a,1); A_plots({['meshSave/' fileo int2str(steps)]},... - [fileo ... + ['plots/' fileo ... int2str(steps)]); %% Bla bla -- 2.47.3