4 % Stiff (#
benchStiffP1) and StiffElas (
#benchStiffElasP1) matrices.
5 % For each assembly matrices, we compare cputimes of corresponding functions
6 %
for version
'base',
'OptV0',
'OptV1' and
'OptV2'.
9 % - 'save' : true for saving each bench in latex files. (default false)
10 % - 'directory' : name of the directory for saving `\LaTeX{}` files.
11 % - 'name' : base name of `\LaTeX{}` files.
12 % - 'LN' : List of N parameters for #SquareMesh function.
16 % runBenchs('save',true,'name','benchMatlabR2012b','LN',20:20:160)@endverbatim
18 % Results under Matlab R2012b:
19 % Here are the results on our reference machine .
20 % - functions <b>MassAssemblingP1</b>
21 % ``\mbox{\input{\INPUTLATEXDIR/benchMatlabR2012b_MassP1.tex}} ``
22 % - functions <b>MassWAssemblingP1</b>
23 % ``\mbox{\input{\INPUTLATEXDIR/benchMatlabR2012b_MassWP1.tex}} ``
24 % - functions <b>StiffAssemblingP1</b>
25 % ``\mbox{\input{\INPUTLATEXDIR/benchMatlabR2012b_StiffP1.tex}} ``
26 % - functions <b>StiffElasAssembling</b>
27 % ``\mbox{\input{\INPUTLATEXDIR/benchMatlabR2012b_StiffElasP1.tex}} ``
29 % % Results under Octave 3.6.3:
30 % Here are the results on our reference machine .
31 % - functions <b>MassAssemblingP1</b>
32 % ``\mbox{\input{\INPUTLATEXDIR/benchOctave3.6.3_MassP1.tex}} ``
33 % - functions <b>MassWAssemblingP1</b>
34 % ``\mbox{\input{\INPUTLATEXDIR/benchOctave3.6.3_MassWP1.tex}} ``
35 % - functions <b>StiffAssemblingP1</b>
36 % ``\mbox{\input{\INPUTLATEXDIR/benchOctave3.6.3_StiffP1.tex}} ``
37 % - functions <b>StiffElasAssembling</b>
38 % ``\mbox{\input{\INPUTLATEXDIR/benchOctave3.6.3_StiffElasP1.tex}} ``
44 % OptFEM2DP1 [V1.2b1] - Copyright (C) 2013 CJS (LAGA)
46 % This file is part of OptFEM2DP1.
47 % OptFEM2DP1 is free software: you can redistribute it and/or modify
48 % it under the terms of the GNU General Public License as published by
49 % the Free Software Foundation, either version 3 of the License, or
50 % (at your option) any later version.
52 % OptFEM2DP1 is distributed in the hope that it will be useful,
53 % but WITHOUT ANY WARRANTY; without even the implied warranty of
54 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
55 % GNU General Public License
for more details.
57 % You should have received a copy of the GNU General Public License
58 % along with
this program. If not, see <http:
66 p=p.addParamValue('save', false, @islogical );
67 p=p.addParamValue('directory', 'latex' , @ischar );
68 p=p.addParamValue('name', 'bench' , @ischar );
69 p=p.addParamValue('LN', [20:20:100] , @isnumeric );
70 p=p.parse(varargin{:});
72 p.addParamValue(
'save',
false, @islogical );
73 p.addParamValue(
'directory',
'latex' , @ischar );
74 p.addParamValue(
'name',
'bench' , @ischar );
75 p.addParamValue(
'LN', [20:20:100], @isnumeric );
80 [succes,message,messageid] = mkdir(p.Results.directory);
88 BenchToLatexTabular(BenchMassP1,[p.Results.directory,filesep,p.Results.name,'_MassP1.tex']);
94 BenchToLatexTabular(BenchMassWP1,[p.Results.directory,filesep,p.Results.name,'_MassWP1.tex']);
100 BenchToLatexTabular(BenchStiffP1,[p.Results.directory,filesep,p.Results.name,'_StiffP1.tex']);
105 % Build LaTeX tabular
106 BenchToLatexTabular(BenchStiffElasP1,[p.Results.directory,filesep,p.Results.name,'_StiffElasP1.tex']);
110 function BenchToLatexTabular(bench,LaTeXFilename)
112 Data=[bench.Ldof',T(:,1),T(:,1)./T(:,1),T(:,2),T(:,1)./T(:,2),T(:,3),T(:,1)./T(:,3),T(:,4),T(:,1)./T(:,4)];
113 Header={
'$n_{dof}$',
'base',
'OptV0',
'OptV1',
'OptV2'};
114 DataFormat={
'$%d$',
'\\begin{tabular}{c} %.3f (s)\\\\ \\texttt{x %.2f} \\end{tabular}', ...
115 '\\begin{tabular}{c} %.3f (s)\\\\ \\texttt{x %.2f} \\end{tabular}', ...
116 '\\begin{tabular}{c} %.3f (s)\\\\ \\texttt{x %.2f} \\end{tabular}', ...
117 '\\begin{tabular}{c} %.3f (s)\\\\ \\texttt{x %.2f} \\end{tabular}'};
118 ColumnFormat=
'|r||*{4}{c|}';
120 RowHeaderFormat=
'\hline \hline';
121 PrintDataInLatexTabular(Data,Header,DataFormat,ColumnFormat,RowFormat,RowHeaderFormat,LaTeXFilename)