rbmatlab  1.13.10
 All Classes Namespaces Files Functions Variables Groups Pages
neumann_values_affine_decomposed.m
1 function gneu = neumann_values_affine_decomposed(glob, U, normals, params)
2 %function gneu = neumann_values_affine_decomposed(glob, U, normals, params)
3 %
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.
7 %
8 % the function is given by function pointer to components and coefficients:
9 % params.neumann_values_coefficients_ptr
10 % Function must
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
15 % Functions must
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
20 %
21 % Linear combination of components by coefficients then yields the
22 % complete evaluation.
23 
24 % Bernard Haasdonk 27.8.2009
25 
26 % determine affine_decomposition_mode as integer
27 % glob column check
28 % normals column check
29 if params.debug
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');
32  if params.debug > 2
33  keyboard;
34  end
35  end
36 end
37 if params.debug
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');
40  if params.debug > 2
41  keyboard;
42  end
43  end
44 end
45 decomp_mode = params.decomp_mode;
46 
47 if decomp_mode == 2
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);
55 end;
56 %| \docupdate