rbmatlab  1.16.09
 All Classes Namespaces Files Functions Variables Modules Pages
dirichlet_values_leftright.m
1 function Udirichlet = dirichlet_values_leftright(glob, params)
2 % function Udirichlet = dirichlet_values_leftright(glob, params)
3 %
4 % function computing dirichlet-values by pointwise evaluations
5 %
6 % required fields of params:
7 % dir_middle : x coordinate where left and right regions are separated
8 % c_dir_left : left dirichlet value
9 % c_dir_right : right dirichlet value
10 %
11 % optional fields of params:
12 % mu_names : names of fields to be regarded as parameters in vector mu
13 %
14 % in 'coefficients' mode, the parameters in brackets are empty
15 
16 % glob column check
17 if params.debug
18  if ~isempty(glob) && size(glob,1) < size(glob,2)
19  warning('coordinates in variable glob are given row-wise, but expected them to be column-wise');
20  if params.debug > 2
21  keyboard;
22  end
23  end
24 end
25 decomp_mode = params.decomp_mode;
26 
27 
28 if decomp_mode == 2
29  Udirichlet = [params.c_dir_left, params.c_dir_right];
30 else
31  i = (glob(:,1) <= params.dir_middle);
32  if decomp_mode == 1
33  Udirichlet = {i, (1-i)};
34  elseif decomp_mode == 0
35  Udirichlet = params.c_dir_left * i + (1-i) * params.c_dir_right;
36  end
37 end
38 
39 %| \docupdate