1 function U = fv_init_values(model,model_data)
2 %
function U = fv_init_values(model,model_data)
4 %
function computing the init-value DOF vector by evaluating the
5 % grid-center-of-gravity. In particular used for 1st order FV-schemes.
7 % required fields of model as used in model.init_values_ptr
9 % Function supports affine decomposition, i.e. different operation modes
10 % guided by optional field decomp_mode in params. See also the
11 % contents.txt for general explanation
13 % required fileds in model
14 % init_values_ptr: function pointer to init values function
16 % in 'coefficient' mode the model_data structure is empty
18 % Bernard Haasdonk 22.7.2006
21 error('wrong number of parameters!');
24 % affine decomposition is supported by init_data, so automatically
27 decomp_mode = model.decomp_mode;
29 % TODO: The here called
function init_values is still an old one that expects a
30 %
"params" structure as last argument and uses
string comparisons in order to
31 % choose the right initial data
function. This part should therefore be
32 % rewritten with an implementation of
function pointers.
34 U = model.init_values_ptr([],model);
36 grid = model_data.grid;
37 % initial values by midpoint evaluation
38 U = model.init_values_ptr([grid.CX(:),grid.CY(:)],model);