OptFEM3DP1 Toolbox  V1.0
Matlab/Octave Optimized P1-Lagrange Finite Element Method in 3D
 All Files Functions Variables Pages
benchStiff3DP1.m File Reference

Benchmark function for StiffAssembling $P_1$ functions. More...

Go to the source code of this file.

Functions

function bench = benchStiff3DP1 (varargin)
 Benchmark function for StiffAssembling $P_1$ 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
 

Variables

 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
 

Detailed Description

Benchmark function for StiffAssembling $P_1$ functions.

Definition in file benchStiff3DP1.m.

Function Documentation

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 $P_1$ 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
benchStiff3DP1 ( [ "LN", LN_value ] [, "version", version_value ]
[, "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)   
)
fprintf ( )
if isempty ( p.Results.  mesh)
p parse ( varargin  [:])
T ( k  ,
 
)
T ( k  ,
 
)
tic ( )

Variable Documentation

else GenMesh =@(N) GetMeshOpt(sprintf(" %s-%d.mesh ",p.Results.mesh,N))

Definition at line 39 of file benchStiff3DP1.m.

iscell

Definition at line 22 of file benchStiff3DP1.m.

end k =1

Definition at line 31 of file benchStiff3DP1.m.

bench Ldof =Ldof

Definition at line 70 of file benchStiff3DP1.m.

bench LN =p.Results.LN

Definition at line 71 of file benchStiff3DP1.m.

bench Lnq =Lnq

Definition at line 69 of file benchStiff3DP1.m.

M =Assembling(Th.nq,Th.nme,Th.q,Th.me,Th.volumes)

Definition at line 61 of file benchStiff3DP1.m.

Mb =Assembling(Th.nq,Th.nme,Th.q,Th.me,Th.volumes)

Definition at line 53 of file benchStiff3DP1.m.

bench meshdesc =" CubeMesh(<N>) "

Definition at line 37 of file benchStiff3DP1.m.

end for N
Initial value:
=p.Results.LN
Th=GenMesh(N)

Definition at line 43 of file benchStiff3DP1.m.

nv =length(version)

Definition at line 33 of file benchStiff3DP1.m.

p =p.addParamValue('mesh','',@ischar)

Definition at line 23 of file benchStiff3DP1.m.

printMesh =@(N) sprintf(" CubeMesh(%d) ",N)

Definition at line 36 of file benchStiff3DP1.m.

end bench T =T

Definition at line 68 of file benchStiff3DP1.m.

bench version =p.Results.version

Definition at line 32 of file benchStiff3DP1.m.