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