rbmatlab  1.16.09
 All Classes Namespaces Files Functions Variables Modules Pages
conv_flux_affine_decomposed.m
Go to the documentation of this file.
1 function flux = conv_flux_affine_decomposed(glob, U, params)
2 %function flux = conv_flux_affine_decomposed(glob, U, params)
3 % function evaluating a function in the list of global coordinates
4 % specified in the columns of 'glob'.
5 %
6 % The result is a matrix of flux vector results as columns of flux.
7 %
8 % The function is given by function pointer to components and coefficients
9 % required fields of params:
10 % conv_flux_coefficients_ptr: Function must
11 % allow call 'flux = f(params)' Return is a vector of length
12 % 'Q' with (parameter dependent) coefficients in flux.
13 % conv_flux_components_ptr: Functions must
14 % allow call 'flux = f(glob,U,params)' Return of components is
15 % a cell array of matrices of the same size as 'glob' with the
16 % point values of the flux.
17 %
18 % Linear combination of components by coefficients then yields the
19 % complete 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  flux = params.conv_flux_coefficients_ptr(params);
37 elseif decomp_mode == 1; % components
38  flux = params.conv_flux_components_ptr(glob,params);
39 else % decomp_mode = 0, complete
40  flux_coefficients = params.conv_flux_coefficients_ptr(params);
41  flux_components = params.conv_flux_components_ptr(glob,params);
42  flux = lincomb_sequence(flux_components,flux_coefficients);
43 end;
44 
function flux = conv_flux_affine_decomposed(glob, U, params)
function evaluating a function in the list of global coordinates specified in the columns of glob...