-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_matlab.m
58 lines (43 loc) · 1.25 KB
/
run_matlab.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
% FEM Benchmark Matlab and Octave test run script.
% Copyright 2013-2022 Precise Simulation, Ltd.
clear all
path_to_featool = which('featool.m');
path_to_featool = 'C:\featool\featool.m';
if( ~isempty(path_to_featool) )
path_to_featool = fileparts( path_to_featool );
else
path_to_featool = input('Please enter the path to your FEATool toolbox installation: ','s')
end
if( exist('OCTAVE_VERSION','builtin') )
warning( 'off', 'Octave:shadowed-function' )
end
addpath( genpath(path_to_featool) );
addpath( 'src_matlab' );
% n0 = 32
% nlev = 6
% nruns = 20
params = load( 'testrun_param.txt' );
n0 = params(1);
nlev = params(2);
nruns = params(3);
fem_poisson(n0);
timings = zeros(nlev,9);
for ilev = 1:nlev
n = n0*2^(ilev-1);
timings_ilev = zeros(1,8);
for i = 1:max(3,nruns)
[~,timings_i] = fem_poisson( n );
if i ~= 1 && i ~= nruns
timings_ilev = timings_ilev + timings_i;
end
end
timings_ilev = timings_ilev/(nruns - 2);
timings(ilev,1) = n0*2^(ilev-1);
timings(ilev,2:end) = timings_ilev;
end
if( exist('OCTAVE_VERSION','builtin') )
save( 'output/output_octave.txt', 'timings', '-ascii' )
else
save( 'output/output_matlab.txt', 'timings', '-ascii' )
end
exit