rbmatlab  1.13.10
 All Classes Namespaces Files Functions Variables Groups Pages
test_rb_local_ext.m
Go to the documentation of this file.
1 function OK = test_rb_local_ext
2 % function performing a test wether all necessary cells surrounding an
3 % interpolation point are selected during the reduced_data generation phase.
4 %
5 % returns 1, if test is OK, 0 otherwise
6 
7 % Martin Drohmann 21.05.2008
8 
9 OK = 1;
10 
11 gradient_approx_matrix_common_settings;
12 
13 %detailed_data = structcpy([], model_data);
14 
15 params.xnumintervals = 5;
16 params.ynumintervals = 5;
17 
18 params.stencil_mode = 'vertex';
19 
20 detailed_data = nonlin_evol_gen_model_data(params);
21 
22 % we define, there is only one interpolation point at index 8
23 detailed_data.TM{1} = 8;
24 % create some dummy reduced basis / collateral basis
25 detailed_data.QM{1} = ones(25,1);
26 detailed_data.RB = (1:25)';
27 detailed_data.BM{1} = 1;
28 
29 detailed_data.implicit_crb_index = 1;
30 detailed_data.explicit_crb_index = 1;
31 
32 % the points we expect to be selected
33 ref_RB = [2:4,7:9,12:14]';
34 reduced_data = nonlin_evol_gen_reduced_data(params, detailed_data);
35 
36 if length(reduced_data.RB_local_ext{1}) ~= length(ref_RB) ...
37  || ~all(all(reduced_data.RB_local_ext{1} == ref_RB))
38  disp('local gridpart construction is faulty!');
39  OK = 0;
40 end
41 
42 end
43 
44 %| \docupdate