1 function U0 = init_values_bl(glob,params)
2 %
function U0 = init_values_bl(glob,params)
4 %
function constructing the initial values of the convection diffusion
5 % problem in the specified global points glob and parameters.
6 % It returns an initial data
function that is mosly homogeneous with several
7 % (seven) blob like structures of higher concentration that drops exponentially
8 % away from their centres.
10 % required fields in params
11 % c_init: constant
for homogeneous initial data to be returned
13 % in
'coefficient' mode the model_data structure is empty
15 % Martin Drohmann 23.9.2009
19 if ~isempty(glob) && size(glob,1) < size(glob,2)
20 warning('coordinates in variable glob are given row-wise, but expected them to be column-wise');
27 decomp_mode = params.decomp_mode;
29 if ~isfield(params, 'c_width')
30 params.c_width = 0.35;
32 if ~isfield(params, 'c_height')
33 params.c_height = 0.50;
36 xoff = params.c_width/2;
37 yoff = params.c_height/2;
40 U0 = [params.c_high, params.c_low];
45 square = X>0.4-xoff & X<0.4+xoff & Y>0.5-yoff & Y < 0.5+yoff;
48 U0 = zeros(length(X),1);
49 U0(square) = params.c_high;
50 U0(U0 == 0) = params.c_low;
52 elseif decomp_mode == 1
54 U0{1} = zeros(length(X),1);
55 U0{2} = zeros(length(X),1);
59 error([
'decomp_mode number ' decomp_mode,
' is unknown.']);