3 %
function computing the convective flux `f(u) = v u` of a convection
6 % required fields of params:
7 % t : real time value in
case of time-dependent flux
8 % velocity_ptr : pointer to
function providing the velocity field `v`.
10 % Bernard Haasdonk 4.4.2006
12 % determine affine_decomposition_mode as integer
15 if ~isempty(glob) && size(glob,1) < size(glob,2)
16 warning('coordinates in variable glob are given row-wise, but expected them to be column-wise');
22 decomp_mode = params.decomp_mode;
24 vel = params.velocity_ptr(glob,params);
26 if decomp_mode == 2 % i.e. 'coefficients'
27 flux = vel; % copy of coefficient vector from linear flux
28 elseif decomp_mode == 0 % i.e. 'none'
29 if ~isempty(vel) % otherwise size 0/0 => 0/1 !!!!!
30 flux = [vel(:,1).* U(:), vel(:,2).* U(:)];
31 lambda = 1/max(sqrt(vel(:,1).^2 + vel(:,2).^2));
36 elseif decomp_mode == 1 % i.e. 'components'
37 flux = cell(size(vel));
function [ flux , lambda ] = conv_flux_linear(glob, U, params)
function computing the convective flux of a convection problem.