OptFEM2DP1 Toolbox  V1.2b3
Matlab/Octave Optimized P1-Lagrange Finite Element Method in 2D
 All Files Functions Pages
runValids.m
Go to the documentation of this file.
1 function runValids(varargin)
2 % function runValids(varargin)
3 % Run validation tests for Mass (#validMassP1), MassW (#validMassWP1),
4 % Stiff (#validStiffP1) and StiffElas (#validStiffElasP1) matrices.
5 % For each assembly matrix, we make 3 tests
6 % - Test 1 : computation of the assembly Matrix using all the versions giving
7 % errors and computation times.
8 % - Test 2 : comparison of the associated integral and its `P_1`-Lagrange approximation.
9 % - Test 3 : retrieving of numerical order for `P_1`-Lagrange approximation.
10 %
11 % Parameters:
12 % save : set to true to save figures in 'image' directory.
13 % percent : value for resizing the figure (only png format). See #SaveFigure
14 %
15 % Example:
16 % @verbatim
17 % runValids('save',true,'percent',50)@endverbatim
18 %
19 % Results under Matlab R2012b:
20 % Here are the figures for 'Test 3' obtained on our reference machine.
21 % - validMassP1() figure
22 % \image html images/validMassP1.png "figure : Mass Matrix order validation"
23 % - validMassWP1() figure
24 % \image html images/validMassWP1.png "figure : MassW Matrix order validation"
25 % - validStiffP1() figure
26 % \image html images/validStiffP1.png "figure : Stiff Matrix order validation"
27 % - validStiffElasP1() figure
28 % \image html images/validStiffElasP1.png "figure : StiffElas Matrix order validation"
29 %
30 % See also:
31 % #validMassP1, #validMassWP1, #validStiffP1, #validStiffElasP1, #SaveFigure
32 % Copyright:
33 % See \ref license
34 InitOptFEM2D();
35 
36 p = inputParser;
37 
38 if isOctave()
39  p=p.addParamValue('save', false, @islogical );
40  p=p.addParamValue('percent', 50 , @(t) ((t>0)&&(t<=100)) );
41  p=p.parse(varargin{:});
42 else % Matlab
43  p.addParamValue('save', false, @islogical );
44  p.addParamValue('percent', 50 , @(t) ((t>0)&&(t<=100)) );
45  p.parse(varargin{:});
46 end
47 close all
48 
49 figure(1)
50 validMassP1();
51 SaveFigure(p.Results.save,'validMassP1',p.Results.percent)
52 figure(2)
53 validMassWP1();
54 SaveFigure(p.Results.save,'validMassWP1',p.Results.percent)
55 figure(3)
56 validStiffP1();
57 SaveFigure(p.Results.save,'validStiffP1',p.Results.percent)
58 figure(4)
60 SaveFigure(p.Results.save,'validStiffElasP1',p.Results.percent)