rbmatlab  1.16.09
 All Classes Namespaces Files Functions Variables Modules Pages
velocity_constant.m
1 function [vel,lambda] = velocity_constant(glob, params)
2 %function [vel,lambda] = velocity_constant(glob, 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 % velocity field is assumed to be constant given by vector
12 % params.transport_x and params.transport_y
13 
14 % Martin Drohmann 23.9.2009
15 
16 % glob column check
17 if params.debug
18  if ~isempty(glob) && size(glob,1) < size(glob,2)
19  warning('coordinates in variable glob are given row-wise, but expected them to be column-wise');
20  if params.debug > 2
21  keyboard;
22  end
23  end
24 end
25 
26 lambda = 0;
27 decomp_mode = params.decomp_mode;
28 
29 if decomp_mode == 2
30  vel = 1; % single component factor 1
31 elseif decomp_mode == 1 % components:
32  vel = cell(1,1);
33  vel{1} = zeros(length(glob),2);
34  vel{1}(:,1) = params.transport_x * ones(1,length(glob));
35  vel{1}(:,2) = params.transport_y * ones(1,length(glob));
36 else % decomp_mode = 0, complete:
37  vel = zeros(length(glob),2);
38  vel(:,1) = params.transport_x * ones(1,length(glob));
39  vel(:,2) = params.transport_y * ones(1,length(glob));
40  lambda = max(max(vel))^-1; % correct up to a factor
41 end;
42 
43 %| \docupdate