1 function vel = velocity(X,Y,params)
2 %
function vel = velocity(X,Y,params)
4 %
function computing a vectorial velocity by pointwise
5 % evaluation in the point sequences indicated by X and Y.
8 % name_velocity =
'linear'
11 % k : scalar diffusivity parameter
13 % Function supports affine decomposition, i.e. different operation modes
14 % guided by optional field affine_decomp_mode in params. See also the
15 % contents.txt
for general explanation
17 % optional fields of params:
18 % mu_names : names of fields to be regarded as parameters in vector mu
19 % affine_decomp_mode: operation mode of the
function
20 %
'none' (
default): no parameter dependence or decomposition is
21 % performed. output is as described above.
22 %
'components': For each output argument a cell array of output
23 % arguments is returned representing the q-th component
24 % independent of the parameters given in mu_names
25 %
'coefficients': For each output argument a cell array of output
26 % arguments is returned representing the q-th coefficient
27 % dependent of the parameters given in mu_names
29 % in
'coefficients' mode, the parameters in brackets are empty
31 % Bernard Haasdonk 11.4.2006
33 % determine affine_decomposition_mode as integer
34 decomp_mode = get_affine_decomp_mode(params);
35 decomp_mode = params.decomp_mode;
36 % flag indicating whether the computation respected the decomposition
37 respected_decomp_mode = 0;
41 if isequal(params.name_velocity,
'linear')
43 vel = [params.cx, params.cy];
45 error('no components implemented yet!!');
47 respected_decomp_mode = 1;
49 error('velocity function unknown');
52 if decomp_mode>0 & respected_decomp_mode==0
53 error('function does not support affine decomposition!');
57 % TO BE ADJUSTED TO NEW SYNTAX