2 %
function benchStiffP1()
3 % Benchmark
function for StiffAssembling `P_1` functions.
8 % bench=
benchStiff3DP1(
'LN',[5:5:20],
'version',{
'OptV1',
'OptV2'},
'mesh',
'./mesh/cube');
10 % #StiffAssemblingP1base, #StiffAssemblingP1OptV0, #StiffAssemblingP1OptV1, #StiffAssemblingP1OptV2
18 p=p.addParamValue(
'mesh',
'',@ischar);
19 p=p.parse(varargin{:});
21 p.addParamValue(
'LN', [20:10:60], @isnumeric );
22 p.addParamValue(
'version', {
'base',
'OptV0',
'OptV1',
'OptV2'}, @
iscell );
23 p.addParamValue(
'mesh',
'',@ischar);
40 fprintf('---------------------------------------------------------\n')
41 fprintf('BENCH (Stiffness Matrix Assembling) %d\n',k)
43 fprintf(' Vertices number : %d - Tetrahedra number : %d\n',Th.nq,Th.nme)
46 eval(sprintf('Assembling=@(nq,nme,q,me,volumes) StiffAssembling3DP1%s(nq,nme,q,me,volumes);',
version{1}));
48 Mb=Assembling(Th.nq,Th.nme,Th.q,Th.me,Th.volumes);
54 eval(sprintf(
'Assembling=@(nq,nme,q,me,volumes) StiffAssembling3DP1%s(nq,nme,q,me,volumes);',
version{v}));
56 M=Assembling(Th.nq,Th.nme,Th.q,Th.me,Th.volumes);
58 fprintf(
' CPU times %5s : %3.4f (s) - Error = %e - Speed Up X%3.3f\n',
version{v},
T(k,v),norm(
Mb-
M,Inf),
T(k,1)/
T(k,v))
66 bench.LN=p.Results.LN;