rbmatlab  1.16.09
 All Classes Namespaces Files Functions Variables Modules Pages
stokes_gen_model_data.m
1 function model_data = stokes_gen_model_data(model)
2 %function model_data = stokes_gen_model_data(model)
3 %
4 % generated fields of model_data:
5 % - grid
6 % - df_info
7 % - bc_info: structure holding information on the boundary conditions. One
8 % can specify boundary parts via model.bnd_rect_corner1 and
9 % model.bnd_rect_corner2. For boundary integrals one has to group the
10 % rectangles with numbers < -1 in model.bnd_rect_index. The boundaries not
11 % assigned in this way are used for Dirichlet conditions by default. It is
12 % also possible to define Dirichlet constraints for chosen dimensions of
13 % the field variable in model.bnd_dimrange_index. Then the rectangles have
14 % to be given explicitly.
15 
16 % I. Maier, 22.01.2014
17 
18 
19 %% grid
20 grid = construct_grid(model);
21 
22 
23 %% discrete function info
24 switch model.df_type
25 
26  case 'lagrangian' % specify polynomial degree in model
27  df_info = Fem.Lagrange.DefaultInfo(model.pdeg, grid);
28 
29  if model.dimrange > 1
30  ids = cell(1, model.dimrange);
31  for i = 1:model.dimrange
32  ids{i} = ['dim', num2str(i)];
33  end
34 
35  df_info = Fem.CompositeFunctionSpace(ids, repmat({df_info}, 1, model.dimrange));
36  end
37 
38  case 'stokes_mini'
39  velocity_comp = Fem.Lagrange.BubbleInfo([], grid);
40 
41  ids = {'velocity', 'pressure'};
42  values = struct(...
43  'velocity', Fem.CompositeFunctionSpace(velocity_comp, 'dim1', velocity_comp, 'dim2'), ...
44  'pressure', Fem.Lagrange.DefaultInfo(1, grid));
45 
46  df_info = Fem.CompositeFunctionSpace(ids, values);
47 
48  case 'taylor_hood' % specify polynomial degree of velocity components in model
49  velocity_comp = Fem.Lagrange.DefaultInfo(model.pdeg, grid);
50 
51  ids = {'velocity', 'pressure'};
52  values = struct(...
53  'velocity', Fem.CompositeFunctionSpace(velocity_comp, 'dim1', velocity_comp, 'dim2'), ...
54  'pressure', Fem.Lagrange.DefaultInfo(model.pdeg - 1, grid));
55 
56  df_info = Fem.CompositeFunctionSpace(ids, values);
57 end
58 
59 
60 %% boundary condition info
61 bc_info = Fem.BcInfo(model, grid, df_info);
62 
63 
64 %% gather data
65 model_data.grid = grid;
66 model_data.df_info = df_info;
67 model_data.bc_info = bc_info;
68 
69 model_data.operators = Fem.OperatorsDefault();
70 model_data.W = model.get_inner_product_matrix(model_data);
71 
72 end
scalar Lagrange FE functions on triangular grid
Definition: DefaultInfo.m:19
Fem operators can be obtained from stored components.
scalar Lagrange FE functions (degree 1) with additional bubble function on triangular grid ...
Definition: BubbleInfo.m:19
Composite function space for composition of FE function spaces on same grid.
Class for boundary condition information. Allows more flexible usage.
Definition: BcInfo.m:18