rbmatlab  1.16.09
 All Classes Namespaces Files Functions Variables Modules Pages
dom_dec_gen_model_data.m
1 function model_data = dom_dec_gen_model_data(model)
2 % function model_data = dom_dec_model_data(model)
3 %
4 % function computing required data for the simulation of model
5 % currently only supporting polynomial degree 1
6 %
7 % Generated fields of model_data:
8 % grids: cell containing the grids for both subdomains
9 % df_infos: cell containing the infos for the discrete function
10 % spaces on the subdomains
11 % gamma_dofs: cell containing indices of the dofs on the interface
12 % gamma in same order
13 % masks: cell containing vectors for extracting a discrete
14 % function on a subdomain out of a function on the whole domain
15 % base_model_data: required data for the simulation of the
16 % base_model
17 
18 % I.Maier, 19.07.2011
19 
20 model_data = [];
21 model_data.df_infos = cell(1,2);
22 model_data.gamma_dofs = cell(1,2);
23 model_data.masks = cell(1,2);
24 model_data.gamma_inner_product_matrices = cell(1,2);
25 model_data.mu_ref_extension_matrices = cell(1,2);
26 
27 % full grid:
28 grid = construct_grid(model.base_model); %structure storing much
29  %geometrical information
30 
31 model_data.base_model_data = [];
32 model_data.base_model_data.df_info = feminfo(model.base_model, ...
33  grid);
34 
35 inds = cell(1,2);
36 % find indices of elements in omega_1
37 for i = 1:length(model.dd_rect_corner1)
38  ind_tmp = find( (grid.CX>model.dd_rect_corner1{i}(1)) & ...
39  (grid.CY>model.dd_rect_corner1{i}(2)) & ...
40  (grid.CX<model.dd_rect_corner2{i}(1)) & ...
41  (grid.CY<model.dd_rect_corner2{i}(2)) );
42  inds{1} = [inds{1};ind_tmp];
43 end;
44 
45 % indices of elements in omega_2
46 inds{2} = setdiff(1:grid.nelements,inds{1});
47 
48 % subgrids:
49 grids = cell(1,2);
50 for i = 1:2
51  grids{i} = gridpart(grid,inds{i});
52  % structures containing information about the fe-function space
53  model_data.df_infos{i} = feminfo(model.base_model,grids{i});
54 end;
55 
56 % generate index vectors of vertices on gamma in same order
57 masks = cell(1,2);
58 for i = 1:2
59  masks{i} = zeros(grid.nvertices,1);
60  masks{i}(grid.VI(inds{i},:)) = 1;
61  masks{i} = logical(masks{i});
62 end;
63 gamma_vind = (masks{1}==masks{2});
64 
65 % supports only pdeg = 1!
66 for i = 1:2
67  model_data.gamma_dofs{i} = ...
68  setdiff(find(gamma_vind(masks{i})), ...
69  model_data.df_infos{i}.dirichlet_gids);
70 end;
71 
72 % the following is needed for error computation
73 for i = 1:2
74  model_data.masks{i} = masks{i};
75 end;
76 
77 % compute inner product matrices on gamma (L2 and H10)
78 no_dir = mod(model.dirichlet_side,2)+1;
79 [elind,edgeind] = find(grids{no_dir}.NBI == -10);
80 
81 model_data.gamma_inner_product_matrices{1} = ...
83  model_data.df_infos{no_dir},elind,edgeind);
84 
85 model_data.gamma_inner_product_matrices{2} = ...
87  model_data.df_infos{no_dir},elind,edgeind);
88 
89 model = set_mu(model, model.mu_ref);
90 [dummy1, dummy2, model_data.mu_ref_extension_matrices, dummy3] = ...
91  model.operators(model, model_data);
function G = fem_h10_boundary_inner_product_matrix(df_info, elind, edgeind)
fem_h10_boundary_inner_product_matrix(df_info,elind,edgeind)
structure representing the fem-space information shared by all fem-functions. Implemented as handle c...
Definition: feminfo.m:17
function G = fem_l2_boundary_inner_product_matrix(df_info, elind, edgeind)
fem_l2_boundary_inner_product_matrix(df_info,elind,edgeind)