1 function gneu = neumann_values_affine_decomposed(glob, U, normals, params)
2 %
function gneu = neumann_values_affine_decomposed(glob, U, normals, params)
4 %
function evaluating a
function in the list of global coordinates
5 % specified in the columns of glob. Result is a row vector of neumann
6 % boundary values results as columns of gneu.
8 % the
function is given by
function pointer to components and coefficients:
9 % params.neumann_values_coefficients_ptr
11 % allow call gneu = f(params)
12 % Return is a vector of length Q with (parameter
13 % dependent) coefficients in gneu.
14 % params.neumann_values_components_ptr
16 % allow call gnue = f(glob,U,normals,params)
17 % Return of components is a cell array of vectors of
18 % the same size as size(glob,1) with the values
19 % of the neumann boundary function
21 % Linear combination of components by coefficients then yields the
22 % complete evaluation.
24 % Bernard Haasdonk 27.8.2009
26 % determine affine_decomposition_mode as integer
28 % normals column check
30 if ~isempty(normals) && size(glob,1) < size(glob,2)
31 warning('coordinates in variable normals are given row-wise, but expected them to be column-wise');
38 if ~isempty(glob) && size(glob,1) < size(glob,2)
39 warning('coordinates in variable glob are given row-wise, but expected them to be column-wise');
45 decomp_mode = params.decomp_mode;
48 gneu = params.neumann_values_coefficients_ptr(params);
49 elseif decomp_mode == 1; % components
50 gneu = params.neumann_values_components_ptr(glob,params);
51 else % decomp_mode = 0, complete
52 gneu_coefficients = params.neumann_values_coefficients_ptr(params);
53 gneu_components = params.neumann_values_components_ptr(glob,params);
54 gneu = lincomb_sequence(gneu_components,gneu_coefficients);