rbmatlab  1.16.09
 All Classes Namespaces Files Functions Variables Modules Pages
vi_gen_model_data.m
1 function model_data = vi_gen_model_data(model)
2 %function model_data = vi_gen_model_data(model)
3 %
4 % function generating required data of a uniformly discretized 1D
5 % domain.
6 
7 % Required fields of model:
8 % H: number of grid nodes
9 %
10 % Generated fields of model_data:
11 % X: coordinate vector of grid nodes
12 % dx: step size
13 
14 % I.Maier 30.05.2011
15 
16 model_data = [];
17 
18 
19 switch model.gridtype
20  case 'none' % in principle superfluous
21  %
22  % X = linspace(0,1,model.H+2)';
23  % dx = X(2)-X(1);
24  % model_data.X = X(2:end-1); % open interval
25  % model_data.dx = dx;
26 
27  error('should not be called!');
28 
29  case 'onedgrid'
30  model_data.grid = construct_grid(model);
31  model_data.H = model.xnumintervals -1;
32  model_data.dx = (model.xrange(2)-model.xrange(1))/model.xnumintervals;
33  % model_data.df_info = feminfo(model,model_data.grid);
34  %model_data.inner_product_matrix = ...
35  % model_data.df_info.h10_inner_product_matrix
36 % model_data.H = model_data.df_info.ndofs;
37 
38  otherwise
39  model_data.grid = construct_grid(model);
40  model_data.df_info = feminfo(model,model_data.grid);
41  %model_data.inner_product_matrix = ...
42  % model_data.df_info.h10_inner_product_matrix
43  model_data.H = model_data.df_info.ndofs;
44 end;
a one dimensional grid implementation
Definition: onedgrid.m:17