![]() |
OptFEM2DP1 Toolbox
V1.2
Matlab/Octave Optimized P1-Lagrange Finite Element Method in 2D
|
00001 function runValids(varargin) 00002 % function runValids(varargin) 00003 % Run validation tests for Mass (#validMass2DP1), MassW (#validMassW2DP1), 00004 % Stiff (#validStiff2DP1) and StiffElas (#validStiffElas2DP1) matrices. 00005 % For each assembly matrix, we make 3 tests 00006 % - Test 1 : computation of the assembly Matrix using all the versions giving 00007 % errors and computation times. 00008 % - Test 2 : comparison of the associated integral and its `P_1`-Lagrange approximation. 00009 % - Test 3 : retrieving of numerical order for `P_1`-Lagrange approximation. 00010 % 00011 % Parameters: 00012 % save : set to true to save figures in 'image' directory. 00013 % percent : value for resizing the figure (only png format). See #SaveFigure 00014 % 00015 % Example: 00016 % @verbatim 00017 % runValids('save',true,'percent',50)@endverbatim 00018 % 00019 % Results under Matlab R2012b: 00020 % Here are the figures for 'Test 3' obtained on our reference machine. 00021 % - validMassP1() figure 00022 % \image html images/validMass2DP1.png "figure : Mass Matrix order validation" 00023 % - validMassWP1() figure 00024 % \image html images/validMassW2DP1.png "figure : MassW Matrix order validation" 00025 % - validStiffP1() figure 00026 % \image html images/validStiff2DP1.png "figure : Stiff Matrix order validation" 00027 % - validStiffElasP1() figure 00028 % \image html images/validStiffElas2DP1.png "figure : StiffElas Matrix order validation" 00029 % 00030 % See also: 00031 % #validMass2DP1, #validMassW2DP1, #validStiff2DP1, #validStiffElas2DP1, #SaveFigure, #InitOptFEM2DP1 00032 % Copyright: 00033 % See \ref license 00034 InitOptFEM2DP1(); 00035 00036 p = inputParser; 00037 00038 if isOctave() 00039 p=p.addParamValue('save', false, @islogical ); 00040 p=p.addParamValue('percent', 50 , @(t) ((t>0)&&(t<=100)) ); 00041 p=p.parse(varargin{:}); 00042 else % Matlab 00043 p.addParamValue('save', false, @islogical ); 00044 p.addParamValue('percent', 50 , @(t) ((t>0)&&(t<=100)) ); 00045 p.parse(varargin{:}); 00046 end 00047 close all 00048 00049 figure(1) 00050 validMass2DP1(); 00051 SaveFigure(p.Results.save,'validMass2DP1',p.Results.percent) 00052 figure(2) 00053 validMassW2DP1(); 00054 SaveFigure(p.Results.save,'validMassW2DP1',p.Results.percent) 00055 figure(3) 00056 validStiff2DP1(); 00057 SaveFigure(p.Results.save,'validStiff2DP1',p.Results.percent) 00058 figure(4) 00059 validStiffElas2DP1(0); 00060 SaveFigure(p.Results.save,'validStiffElas2DP1',p.Results.percent)