OptFEM3DP1 Toolbox  V1.0
Matlab/Octave Optimized P1-Lagrange Finite Element Method in 3D
 All Files Functions Variables Pages
runValids.m
Go to the documentation of this file.
1 function runValids(varargin)
2 % function runValids(varargin)
3 % Run validation tests for Mass (#validMass3DP1), Stiff (#validStiffP1),
4 % StiffElas (#validStiffElas3DP1) and MassVF (#validMassVF3DP1) 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 % - validMass3DP1() figure
22 % \image html images/validMass3DP1.png "figure : Mass Matrix order validation"
23 % - validStiff3DP1() figure
24 % \image html images/validStiff3DP1.png "figure : Stiff Matrix order validation"
25 % - validStiffElas3DP1(0) figure
26 % \image html images/validStiffElas3DP1.png "figure : StiffElas Matrix order validation"
27 % - validMassVF3DP1(0) figure
28 % \image html images/validMassVF3DP1.png "figure : MassVF Matrix order validation"
29 %
30 % See also:
31 % #validMass3DP1, #validStiff3DP1, #validStiffElas3DP1, #validMassVF3DP1, #SaveFigure
32 % Copyright:
33 % See \ref license
34 InitOptFEM3D();
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)
51 SaveFigure(p.Results.save,'validMass3DP1',p.Results.percent)
52 figure(2)
54 SaveFigure(p.Results.save,'validMassVF3DP1',p.Results.percent)
55 figure(3)
57 SaveFigure(p.Results.save,'validStiff3DP1',p.Results.percent)
58 figure(4)
60 SaveFigure(p.Results.save,'validStiffElas3DP1',p.Results.percent)