rbmatlab 0.10.01
datafunc/velocity.m
00001 function vel = velocity(X,Y,params)
00002 %function vel = velocity(X,Y,params)
00003 %
00004 % function computing a vectorial velocity by pointwise
00005 % evaluation in the point sequences indicated by X and Y. 
00006 %
00007 % fields of params:
00008 % name_velocity = 'linear'
00009 %
00010 % in case of 'linear'
00011 % k : scalar diffusivity parameter
00012 %
00013 % Function supports affine decomposition, i.e. different operation modes
00014 % guided by optional field affine_decomp_mode in params. See also the 
00015 % contents.txt for general explanation
00016 %
00017 % optional fields of params:
00018 %   mu_names : names of fields to be regarded as parameters in vector mu
00019 %   affine_decomp_mode: operation mode of the function
00020 %     'none' (default): no parameter dependence or decomposition is 
00021 %                performed. output is as described above.
00022 %     'components': For each output argument a cell array of output
00023 %                 arguments is returned representing the q-th component
00024 %                 independent of the parameters given in mu_names  
00025 %     'coefficients': For each output argument a cell array of output
00026 %                 arguments is returned representing the q-th coefficient
00027 %                 dependent of the parameters given in mu_names  
00028 %
00029 % in 'coefficients' mode, the parameters in brackets are empty
00030 
00031 % Bernard Haasdonk 11.4.2006
00032 
00033 % determine affine_decomposition_mode as integer  
00034 decomp_mode = get_affine_decomp_mode(params);
00035 decomp_mode = params.decomp_mode;
00036 % flag indicating whether the computation respected the decomposition
00037 respected_decomp_mode = 0;
00038 
00039 vel = [];
00040 
00041 if isequal(params.name_velocity,'linear')
00042   if decomp_mode == 2
00043     vel = [params.cx, params.cy];    
00044   else
00045     error('no components implemented yet!!');
00046   end;
00047   respected_decomp_mode = 1;
00048 else 
00049   error('velocity function unknown');
00050 end;
00051 
00052 if decomp_mode>0 & respected_decomp_mode==0
00053   error('function does not support affine decomposition!');
00054 end;
00055  
00056 
00057 % TO BE ADJUSTED TO NEW SYNTAX
00058 %| \docupdate 
All Classes Namespaces Files Functions Variables