rbmatlab  1.13.10
 All Classes Namespaces Files Functions Variables Groups Pages
dom_dec_operators.m
Go to the documentation of this file.
1 function [A, r, A_gamma, r_gamma] = dom_dec_operators(model, ...
2  model_data)
3 % function [A, r, A_gamma, r_gamma] =
4 % dom_dec_operators(model,model_data)
5 %
6 % function computing all required matrizes for the simulation
7 %
8 % Required fields of model:
9 % decomp_mode: if 0 or 1, matrizes of the detailed systems are
10 % assembled, if 2 , coefficients for the matrix of the reduced
11 % system are computed
12 
13 % I. Maier, 19.07.2011
14 
15 model.base_model.decomp_mode = model.decomp_mode;
16 
17 A = cell(1,2);
18 r = cell(1,2);
19 for i = 1:2
20 
21  if isfield(model_data,'operators')
22  [A{i}, r{i}] = model_data.operators(i);
23  else
24 
25  if model.decomp_mode < 2
26  model_data.df_info = model_data.df_infos{i};
27  end;
28  [A{i}, r{i}] = model.base_model.operators(model.base_model, ...
29  model_data);
30  end;
31 
32 end;
33 
34 A_gamma = cell(1,2);
35 r_gamma = cell(1,2);
36 
37 % modification on the interface
38 if model.decomp_mode == 0
39 
40  for i = 1:2
41  A_gamma{i} = A{i};
42  r_gamma{i} = r{i};
43  % delete and insert dirichlet rows:
44  gids = model_data.gamma_dofs{i};
45  ndofs = model_data.df_infos{i}.ndofs;
46 
47  A_tmp = sparse(gids,gids,ones(size(gids)),ndofs,ndofs);
48 
49  A_gamma{i}(gids,:) = 0;
50  r_gamma{i}(gids) = 0;
51 
52  A_gamma{i} = A_gamma{i} + A_tmp;
53  end;
54 
55 end;