rbmatlab  1.16.09
 All Classes Namespaces Files Functions Variables Modules Pages
velocity_parabola.m
Go to the documentation of this file.
1 function [vel,lambda] = velocity_parabola(glob, params)
2 % function [vel,lambda] = velocity_parabola(glob, params)
3 % parabolic velocity field
4 %
5 % required fields of params:
6 % c : velocity of parabola-profile in 'params.yrange',
7 % constant in 'x'-direction
8 
9 % glob column check
10 if params.debug
11  if ~isempty(glob) && size(glob,1) < size(glob,2)
12  warning('coordinates in variable glob are given row-wise, but expected them to be column-wise');
13  if params.debug > 2
14  keyboard;
15  end
16  end
17 end
18 
19 % determine affine_decomposition_mode as integer
20 decomp_mode = params.decomp_mode;
21 
22 if decomp_mode==2
23  vel = params.c;
24  %| \todo lambda needs to be set to something more
25  %reasonable for reduced simulations.
26  lambda = 0;
27 else
28  X = glob(:,1);
29  Y = glob(:,2);
30  if decomp_mode == 1
31  vel = { [ zeros(length(X),1), Y(:) .* (1-Y(:)) ] };
32  %| \todo lambda needs to be set to something more
33  %reasonable for reduced simulations.
34  lambda = 0;
35  elseif decomp_mode == 0 % decomp_mode 0
36  % determine lambda_jl to be globally constant such that
37  % lambda_jl * sup_u n_jl * f'(u) <= 1
38  % f'(u) = v(x,y)
39  % e.g. lambda := 1/sup|v(x,y)|
40  lambda = 1/(abs(params.c)/4.0+ 1e-10); % some eps for divby0
41  vel = [ zeros(length(X),1), params.c * Y(:) .* (1-Y(:)) ];
42  else
43  error('unknown decmposition mode!!');
44  end
45 end
46 
47 %| \docupdate
function [ vel , lambda ] = velocity_parabola(glob, params)
parabolic velocity field