Benchmark function for StiffAssembling
functions.
More...
Go to the source code of this file.
|
| function
bench = | benchStiff3DP1 (varargin) |
| | Benchmark function for StiffAssembling functions.
|
| |
| else p | addParamValue ('LN',[20:10:60],@isnumeric) |
| |
| p | addParamValue ('version',{'base','OptV0','OptV1','OptV2'},@iscell) |
| |
| p | addParamValue ('mesh','',@ischar) |
| |
| p | parse (varargin[:]) |
| |
| if | isempty (p.Results.mesh) GenMesh |
| |
| | fprintf (" ---------------------------------------------------------\n ") fprintf(" BENCH (Stiffness Matrix Assembling) %d\n " |
| |
| k | fprintf (" Mesh generation with : %s\n ", printMesh(N)) |
| |
| | fprintf (" Vertices number : %d - Tetrahedra number : %d\n ", Th.nq, Th.nme) Lnq(k) |
| |
| | eval (sprintf(" Assembling=@(nq,nme,q,me,volumes) StiffAssembling3DP1%s(nq,nme,q,me,volumes); ", version[1])) |
| |
| | tic () |
| |
| | T (k, 1) |
| |
| | fprintf (" Matrix size : %d\n ", length(Mb)) Ldof(k) |
| |
| | fprintf (" CPU times %5s (ref) : %3.4f (s)\n ", version[1], T(k, 1)) for v |
| |
| | T (k, v) |
| |
| | 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)) end k |
| |
|
| | iscell |
| |
| | p =p.addParamValue('mesh','',@ischar) |
| |
| end | k =1 |
| |
| | version =p.Results.version |
| |
| | nv =length(version) |
| |
| | printMesh =@(N) sprintf(" CubeMesh(%d) ",N) |
| |
| | meshdesc =" CubeMesh(<N>) " |
| |
| else | GenMesh =@(N) GetMeshOpt(sprintf(" %s-%d.mesh ",p.Results.mesh,N)) |
| |
| end for | N |
| |
| | Mb =Assembling(Th.nq,Th.nme,Th.q,Th.me,Th.volumes) |
| |
| | M =Assembling(Th.nq,Th.nme,Th.q,Th.me,Th.volumes) |
| |
| end bench | T =T |
| |
| bench | Lnq =Lnq |
| |
| bench | Ldof =Ldof |
| |
| bench | LN =p.Results.LN |
| |
Benchmark function for StiffAssembling
functions.
Definition in file benchStiff3DP1.m.
| else p addParamValue |
( |
'LN' |
, |
|
|
@ |
isnumeric |
|
) |
| |
| p addParamValue |
( |
'version' |
, |
|
|
{'base','OptV0','OptV1','OptV2'} |
, |
|
|
@ |
iscell |
|
) |
| |
| p addParamValue |
( |
'mesh' |
, |
|
|
'' |
, |
|
|
@ |
ischar |
|
) |
| |
| function bench = benchStiff3DP1 |
( |
|
varargin | ) |
|
Benchmark function for StiffAssembling
functions.
Usage bench=benchStiff3DP1(LN,[5:5:20]); bench=benchStiff3DP1(LN,[5:5:20],version,{OptV1,OptV2}); bench=benchStiff3DP1(LN,[5:5:20],version,{OptV1,OptV2},mesh,./mesh/cube);
- See Also
- #StiffAssemblingP1base, #StiffAssemblingP1OptV0, #StiffAssemblingP1OptV1, #StiffAssemblingP1OptV2
- Copyright
- See License issues
- Parameters
-
| varargin |
[, "mesh", mesh_value ] )
Named Parameters for varargin:
- LN LN ( Default:
[20:10:60] )
- version version ( Default:
{base,OptV0,OptV1,OptV2} )
- mesh mesh ( Default:
' )
|
- Generated fields of bench:
Definition at line 17 of file benchStiff3DP1.m.
| eval |
( |
sprintf(" Assembling=@(nq,nme,q,me,volumes) StiffAssembling3DP1%s(nq,nme,q,me,volumes); ", version[1]) |
| ) |
|
| fprintf |
( |
" ---------------------------------------------------------\n " |
| ) |
|
| k fprintf |
( |
" Mesh generation with : %s\n " |
, |
|
|
printMesh(N) |
|
|
) |
| |
| fprintf |
( |
" Vertices number : %d - Tetrahedra number : %d\n " |
, |
|
|
Th. |
nq, |
|
|
Th. |
nme |
|
) |
| |
| fprintf |
( |
" Matrix size : %d\n " |
, |
|
|
length(Mb) |
|
|
) |
| |
| fprintf |
( |
" CPU times %5s (ref) : %3.4f (s)\n " |
, |
|
|
version |
[1], |
|
|
T(k, 1) |
|
|
) |
| |
| if isempty |
( |
p.Results. |
mesh | ) |
|
| else GenMesh =@(N) GetMeshOpt(sprintf(" %s-%d.mesh ",p.Results.mesh,N)) |
| M =Assembling(Th.nq,Th.nme,Th.q,Th.me,Th.volumes) |
| Mb =Assembling(Th.nq,Th.nme,Th.q,Th.me,Th.volumes) |
| bench meshdesc =" CubeMesh(<N>) " |
| printMesh =@(N) sprintf(" CubeMesh(%d) ",N) |
| bench version =p.Results.version |