1 function [vel,lambda] = velocity_constant(glob, params)
2 %
function [vel,lambda] = velocity_constant(glob, params)
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.
8 % Linear combination of components by coefficients then yields the
11 % velocity field is assumed to be constant given by vector
12 % params.transport_x and params.transport_y
14 % Martin Drohmann 23.9.2009
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');
27 decomp_mode = params.decomp_mode;
30 vel = 1; % single component factor 1
31 elseif decomp_mode == 1 % components:
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