rbmatlab  1.16.09
 All Classes Namespaces Files Functions Variables Modules Pages
velocity_transport.m
1 function [vel,lambda] = velocity_transport(glob, ~, params)
2 %function [vel,lambda] = velocity_transport(glob, U, params)
3 %
4 % function evaluating a function in the list of global coordinates
5 % specified in the columns of glob. Result is a matrix of velocity
6 % vectors as columns of vel.
7 %
8 % Linear combination of components by coefficients then yields the
9 % complete evaluation.
10 
11 % Martin Drohmann 23.9.2009
12 
13 % glob column check
14 if params.debug
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');
17  if params.debug > 2
18  keyboard;
19  end
20  end
21 end
22 
23 lambda = 0;
24 decomp_mode = params.decomp_mode;
25 
26 if decomp_mode == 2
27  vel = 1; % single component factor 1
28 elseif decomp_mode == 1 % components:
29  vel = cell(1,1);
30  vel{1} = zeros(length(glob),2);
31  vel{1}(:,1) = params.transport_x * ones(1,length(glob));
32  vel{1}(:,2) = params.transport_y * ones(1,length(glob));
33 else % decomp_mode = 0, complete:
34  vel = zeros(length(glob),2);
35  vel(:,1) = params.transport_x * ones(1,length(glob));
36  vel(:,2) = params.transport_y * ones(1,length(glob));
37  lambda = max(max(vel))^-1; % correct up to a factor
38 end;
39 
40 %| \docupdate