separated constant part in module_w_assembly.f90
[wrf-fire-matlab.git] / femwind / femwind_rate_test_3levels.m
blob96bcdf5e88f915d2d4816ca59b493ca173f749fe
1 function p=femwind_rate_test(pin)
3 disp('basic convergence speed test')
4 p=femwind_main;
5 p.graphics=-2;
6 p.sc_all = 1;
7 p.sc2_all = 1;
8 % p.levels=8;
9 % params.P_by_x=1;  % coarsening proportioned by x  % now always
10 p.coarse_K=1; % 'variational';  
11 p.coarse_K=2; % 'assembly';
12 p.levels=15;
13 p.levels=3; fprintf('levels=%i for debugging only!',p.levels)
14 p.debug_level=0;
15 p.test_fortran=0;
16 if exist('pin','var')
17     f=fieldnames(pin);;
18 else
19     f={};
20 end
21 for i=1:length(f)
22     ff=f{i};
23     fprintf('overiding p.%s=',ff)
24     disp(pin.(ff))
25     p.(ff)=pin.(ff);
26 end
28 p=femwind_main(p);
29 rates(3,1) =  0.066948270621534;  % 3 levels, coarse P variational
30 rates(8,1) =  0.066931756926231;  % 8 levels, coarse P variational
31 rates(8,2) =  0.066930988019406;  % 8 levels, coarse P assembly
32 rates(15,2)=  0.066930988013484;  % max levels, coarse P assembly
33 rate = rates(p.levels,p.coarse_K);
34 if abs(p.rate - rate) < 1e-8
35     disp('basic convergence rate test OK')
36 else
37     error(sprintf('something changed, expected convergence rate %g got %g diff %g',...
38        rate,p.rate,rate-p.rate))
39 end
40 end