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