OptFEM2D Toolbox for Matlab  V1.2b1
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 matrices, we make 3 tests
6 % - Test 1 : computation of the assembly Matrix using all the versions giving
7 % errors and cputimes.
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 'Test 3' figures 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 %
33 % OptFEM2DP1 [V1.2b1] - Copyright (C) 2013 CJS (LAGA)
34 %
35 % This file is part of OptFEM2DP1.
36 % OptFEM2DP1 is free software: you can redistribute it and/or modify
37 % it under the terms of the GNU General Public License as published by
38 % the Free Software Foundation, either version 3 of the License, or
39 % (at your option) any later version.
40 %
41 % OptFEM2DP1 is distributed in the hope that it will be useful,
42 % but WITHOUT ANY WARRANTY; without even the implied warranty of
43 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
44 % GNU General Public License for more details.
45 %
46 % You should have received a copy of the GNU General Public License
47 % along with this program. If not, see <http://www.gnu.org/licenses/>.
48 InitOptFEM2D();
49 
50 p = inputParser;
51 
52 if isOctave()
53  p=p.addParamValue('save', false, @islogical );
54  p=p.addParamValue('percent', 50 , @(t) ((t>0)&&(t<=100)) );
55  p=p.parse(varargin{:});
56 else % Matlab
57  p.addParamValue('save', false, @islogical );
58  p.addParamValue('percent', 50 , @(t) ((t>0)&&(t<=100)) );
59  p.parse(varargin{:});
60 end
61 close all
62 
63 figure(1)
64 validMassP1();
65 SaveFigure(p.Results.save,'validMassP1',p.Results.percent)
66 figure(2)
67 validMassWP1();
68 SaveFigure(p.Results.save,'validMassWP1',p.Results.percent)
69 figure(3)
70 validStiffP1();
71 SaveFigure(p.Results.save,'validStiffP1',p.Results.percent)
72 figure(4)
74 SaveFigure(p.Results.save,'validStiffElasP1',p.Results.percent)