OptFEM2D  0.1
Matlab optimized FEM2D
 All Files Functions Groups Pages
benchStiffP1.m
Go to the documentation of this file.
1 function benchStiffP1()
2 % function benchStiffP1()
3 % Benchmark function for StiffAssembling P1 functions.
4 %
5 % See also:
7  LN=[20:20:100];
8  k=1;
9  for N=LN
10  Th=SquareMesh(N);
11  fprintf('---------------------------------------------------------\n')
12  fprintf('BENCH (Stiff Matrix Assembling) %d\n',k)
13  fprintf(' Vertex number : %d - Triangles number : %d\n',Th.nq,Th.nme)
14  fprintf(' Matrix size : %d\n',Th.nq)
15  tic();
16  M=StiffAssemblingP1base(Th.nq,Th.nme,Th.q,Th.me,Th.areas);
17  T(1)=toc();
18  fprintf(' CPU times base (ref) : %3.4f (s)\n',T(1))
19  tic();
20  M=StiffAssemblingP1OptV0(Th.nq,Th.nme,Th.q,Th.me,Th.areas);
21  T(2)=toc();
22  fprintf(' CPU times OptV0 : %3.4f (s) - Speed Up X%3.3f\n',T(2),T(1)/T(2))
23  tic();
24  M=StiffAssemblingP1OptV1(Th.nq,Th.nme,Th.q,Th.me,Th.areas);
25  T(3)=toc();
26  fprintf(' CPU times OptV1 : %3.4f (s) - Speed Up X%3.3f\n',T(3),T(1)/T(3))
27  tic();
28  M=StiffAssemblingP1OptV2(Th.nq,Th.nme,Th.q,Th.me,Th.areas);
29  T(4)=toc();
30  fprintf(' CPU times OptV2 : %3.4f (s) - Speed Up X%3.3f\n',T(4),T(1)/T(4))
31  k=k+1;
32  end