1 function model_data = dom_dec_gen_model_data(model)
2 %
function model_data = dom_dec_model_data(model)
4 %
function computing required data
for the simulation of model
5 % currently only supporting polynomial degree 1
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
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
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);
28 grid = construct_grid(model.base_model); %structure storing much
29 %geometrical information
31 model_data.base_model_data = [];
32 model_data.base_model_data.df_info =
feminfo(model.base_model, ...
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];
45 % indices of elements in omega_2
46 inds{2} = setdiff(1:grid.nelements,inds{1});
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});
56 % generate index vectors of vertices on gamma in same order
59 masks{i} = zeros(grid.nvertices,1);
60 masks{i}(grid.VI(inds{i},:)) = 1;
61 masks{i} = logical(masks{i});
63 gamma_vind = (masks{1}==masks{2});
65 % supports only pdeg = 1!
67 model_data.gamma_dofs{i} = ...
68 setdiff(find(gamma_vind(masks{i})), ...
69 model_data.df_infos{i}.dirichlet_gids);
72 % the following is needed
for error computation
74 model_data.masks{i} = masks{i};
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);
81 model_data.gamma_inner_product_matrices{1} = ...
83 model_data.df_infos{no_dir},elind,edgeind);
85 model_data.gamma_inner_product_matrices{2} = ...
87 model_data.df_infos{no_dir},elind,edgeind);
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...
function G = fem_l2_boundary_inner_product_matrix(df_info, elind, edgeind)
fem_l2_boundary_inner_product_matrix(df_info,elind,edgeind)