-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathtest_sweep.m
More file actions
51 lines (39 loc) · 936 Bytes
/
test_sweep.m
File metadata and controls
51 lines (39 loc) · 936 Bytes
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
% Test input.
input = Input();
% Get mesh and materials
mesh = test_mesh(1);
mat = test_materials(2);
% Quadrature
quadrature = LevelSymmetric(16);
% Boundary
boundary = BoundaryMesh(input, mesh, quadrature);
initialize(boundary, 1);
% Make DD equation
equation = DD2D(mesh, mat, quadrature);
setup_group(equation, 1);
% Make sweeper
sweeper = Sweep2D_mod(input, mesh, mat, quadrature, boundary, equation);
sweeper.d_kernel = 0;
% Make a sweep source
source = ones(number_cells(mesh), 1);
n = 2;
t = zeros(n, 1);
for i = 1:n
tic
phi = sweep(sweeper, source, 1);
t(i) = toc;
end
tmean = mean(t);
tstd = std(t);
disp([' tmean = ',num2str(tmean), ' +/- ', num2str(tstd)])
sweeper.d_kernel = 1;
t = zeros(n, 1);
for i = 1:n
tic
phi = sweep(sweeper, source, 1);
t(i) = toc;
end
tmean = mean(t);
tstd = std(t);
disp([' tmean = ',num2str(tmean), ' +/- ', num2str(tstd)])
%plot_flux(mesh, phi)