rbmatlab  1.16.09
 All Classes Namespaces Files Functions Variables Modules Pages
velocity.m
1 function vel = velocity(X,Y,params)
2 %function vel = velocity(X,Y,params)
3 %
4 % function computing a vectorial velocity by pointwise
5 % evaluation in the point sequences indicated by X and Y.
6 %
7 % fields of params:
8 % name_velocity = 'linear'
9 %
10 % in case of 'linear'
11 % k : scalar diffusivity parameter
12 %
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
16 %
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
28 %
29 % in 'coefficients' mode, the parameters in brackets are empty
30 
31 % Bernard Haasdonk 11.4.2006
32 
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;
38 
39 vel = [];
40 
41 if isequal(params.name_velocity,'linear')
42  if decomp_mode == 2
43  vel = [params.cx, params.cy];
44  else
45  error('no components implemented yet!!');
46  end;
47  respected_decomp_mode = 1;
48 else
49  error('velocity function unknown');
50 end;
51 
52 if decomp_mode>0 & respected_decomp_mode==0
53  error('function does not support affine decomposition!');
54 end;
55 
56 
57 % TO BE ADJUSTED TO NEW SYNTAX
58 %| \docupdate