1 function U0 = init_values_affine_decomposed(glob, params)
2 %
function U0 = 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 initial
6 % data results as columns of U0.
8 % the
function is given by
function pointer to components and coefficients:
9 % params.init_values_coefficients_ptr
11 % allow call U = f(params)
12 % Return is a vector of length Q with (parameter
13 % dependent) coefficients in U.
14 % params.init_values_components_ptr
16 % allow call U = f(glob,params)
17 % Return of components is a cell array of matrices of
18 % the same size as glob with the point values
20 % Linear combination of components by coefficients then yields the
21 % complete evaluation.
23 % Bernard Haasdonk 27.8.2009
25 % determine affine_decomposition_mode as integer
27 if isfield(params,
'debug') && params.debug
28 if ~isempty(glob) && size(glob,1) < size(glob,2)
29 warning('coordinates in variable glob are given row-wise, but expected them to be column-wise');
35 decomp_mode = params.decomp_mode;
38 U0 = params.init_values_coefficients_ptr(params);
39 elseif decomp_mode == 1; % components
40 U0 = params.init_values_components_ptr(glob,params);
41 else % decomp_mode = 0, complete
42 Ucoefficients = params.init_values_coefficients_ptr(params);
43 Ucomponents = params.init_values_components_ptr(glob,params);
44 U0 = lincomb_sequence(Ucomponents,Ucoefficients);