1 function U0 = init_values_transformed_blobs(glob,params)
2 %
function U0 = init_values_transformed_blobs(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
12 % blob_height: addend to c_init
for the maximum concentration of the blobs
14 % in
'coefficient' mode the model_data structure is empty
16 % Martin Drohmann 23.9.2009
20 if ~isempty(glob) && size(glob,1) < size(glob,2)
21 warning('coordinates in variable glob are given row-wise, but expected them to be column-wise');
27 decomp_mode = params.decomp_mode;
29 if any(ismember(fieldnames(params), 'blob_height'))
30 h = params.blob_height;
36 U0 = [1./(1:7),1] .* [ h, h, h, h, h, h, h, params.c_init];
40 B{1} = ((X(:) - 0.5).^2 +(Y(:)-0.7).^2);
41 B{2} = ((X(:) - 0.8).^2 +(Y(:)-0.9).^2);
42 B{3} = ((X(:) - 0.8).^2 +(Y(:)-0.2).^2);
43 B{4} = ((X(:) - 0.2).^2 +(Y(:)-0.2).^2);
44 B{5} = ((X(:) - 0.2).^2 +(Y(:)-0.9).^2);
45 B{6} = ((X(:) - 0.4).^2 +(Y(:)-0.4).^2);
46 B{7} = ((X(:) - 0.6).^2 +(Y(:)-0.6).^2);
50 % p_mu = spline_select(params);
52 I{i} = (B{i} < 0.1.^2);
55 U0 = params.c_init * ones(length(X),1);
57 U0 = U0 + 1/i .* h .* exp(-B{i}) .* I{i};
59 elseif decomp_mode == 1
61 U0{1} = I{1} .* exp(-B{1});
63 U0{i} = I{i} .* exp(-B{i});
65 U0{8} = ones(length(X),1);
67 error([
'decomp_mode number ' params.decomp_mode,
' is unknown.']);