1 function U = dirichlet_values_affine_decomposed(glob, params)
2 %
function U = init_values_affine_decomposed(glob, params)
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.
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.
18 % Linear combination of components by coefficients yields the complete
21 % Bernard Haasdonk 27.8.2009
23 % determine affine_decomposition_mode as integer
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');
33 decomp_mode = params.decomp_mode;
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);