rbmatlab 0.10.01
|
00001 function [vel,lambda] = velocity_parabola(glob, params) 00002 % function [vel,lambda] = velocity_parabola(glob, params) 00003 % parabolic velocity field 00004 % 00005 % required fields of params: 00006 % c : velocity of parabola-profile in 'params.yrange', 00007 % constant in 'x'-direction 00008 00009 % glob column check 00010 if params.debug 00011 if ~isempty(glob) && size(glob,1) < size(glob,2) 00012 warning('coordinates in variable glob are given row-wise, but expected them to be column-wise'); 00013 if params.debug > 2 00014 keyboard; 00015 end 00016 end 00017 end 00018 00019 % determine affine_decomposition_mode as integer 00020 decomp_mode = params.decomp_mode; 00021 00022 if decomp_mode==2 00023 vel = params.c; 00024 %| \todo lambda needs to be set to something more 00025 %reasonable for reduced simulations. 00026 lambda = 0; 00027 else 00028 X = glob(:,1); 00029 Y = glob(:,2); 00030 if decomp_mode == 1 00031 vel = { [ zeros(length(X),1), Y(:) .* (1-Y(:)) ] }; 00032 %| \todo lambda needs to be set to something more 00033 %reasonable for reduced simulations. 00034 lambda = 0; 00035 elseif decomp_mode == 0 % decomp_mode 0 00036 % determine lambda_jl to be globally constant such that 00037 % lambda_jl * sup_u n_jl * f'(u) <= 1 00038 % f'(u) = v(x,y) 00039 % e.g. lambda := 1/sup|v(x,y)| 00040 lambda = 1/(abs(params.c)/4.0+ 1e-10); % some eps for divby0 00041 vel = [ zeros(length(X),1), params.c * Y(:) .* (1-Y(:)) ]; 00042 else 00043 error('unknown decmposition mode!!'); 00044 end 00045 end 00046 00047 %| \docupdate