rbmatlab  1.16.09
 All Classes Namespaces Files Functions Variables Modules Pages
dirichlet_values_affine_decomposed.m
1 function U = dirichlet_values_affine_decomposed(glob, params)
2 %function U = init_values_affine_decomposed(glob, params)
3 %
4 % function evaluating a function in the list of global coordinates
5 % specified in the columns of glob. Result is a matrix of dirichlet
6 % value results as columns of U.
7 %
8 % The function is given by function pointer to components and coefficients:
9 % required fields of params:
10 % dirichlet_values_coefficients_ptr: Function must allow call
11 % 'U =f(params)' Return is a vector of length 'Q' with (parameter
12 % dependent) coefficients in 'U'.
13 % dirichlet_values_components_ptr: Functions must
14 % allow call 'U = f(glob,params)' Return of components is a
15 % cell array of matrices of the same size as 'glob' with the
16 % point values of the components.
17 %
18 % Linear combination of components by coefficients yields the complete
19 % evaluation.
20 
21 % Bernard Haasdonk 27.8.2009
22 
23 % determine affine_decomposition_mode as integer
24 % glob column check
25 if params.debug
26  if ~isempty(glob) && size(glob,1) < size(glob,2)
27  warning('coordinates in variable glob are given row-wise, but expected them to be column-wise');
28  if params.debug > 2
29  keyboard;
30  end
31  end
32 end
33 decomp_mode = params.decomp_mode;
34 
35 if decomp_mode == 2
36  U = params.dirichlet_values_coefficients_ptr(params);
37 elseif decomp_mode == 1; % components
38  U = params.dirichlet_values_components_ptr(glob,params);
39 else % decomp_mode = 0, complete
40  Ucoefficients = params.dirichlet_values_coefficients_ptr(params);
41  Ucomponents = params.dirichlet_values_components_ptr(glob,params);
42  U = lincomb_sequence(Ucomponents,Ucoefficients);
43 end;
44 %| \docupdate