1 function U0 = init_values_blobs(glob,params)
2 %
function U0 = init_values_blobs(glob,params)
4 %
function constructing the initial values of the convection diffusion
5 % problem in the specified global points glob and parameters.
6 % u_0 = beta*exp(-gamma*((x-0.25).^2+(y-0.5).^2))* Xi(B_r) ...
7 % + (1-beta)*exp(-gamma*((x-0.25).^2+(y-0.7).^2))* Xi(B_r)
9 % radius : radius of blob-cutoff circle
10 % gamma : spread of initial-value gaussian
11 % beta : value between 0 and 1 weighting two gauss-blobs
12 % in
'coefficient' mode the model_data structure is empty
14 % Martin Drohmann 23.9.2009
18 if ~isempty(glob) && size(glob,1) < size(glob,2)
19 warning('coordinates in variable glob are given row-wise, but expected them to be column-wise');
26 decomp_mode = params.decomp_mode;
29 U0 = [params.beta, 1-params.beta];
34 B1 = ((X(:)-0.25).^2+(Y(:)-0.5).^2);
35 B2 = ((X(:)-0.25).^2+(Y(:)-0.7).^2);
36 I1 = (B1<params.radius.^2);
37 I2 = (B2<params.radius.^2);
39 U0 = params.beta*exp(-params.gamma*B1).*I1 ...
40 + (1-params.beta)* exp(-params.gamma*B2).*I2;
41 elseif decomp_mode == 1
42 if ismember('gamma',params.mu_names) || ...
43 ismember('radius',params.mu_names)
44 error('affine decomp with respect to mu_names not possible!');
47 U0{1} = exp(-params.gamma*B1).*I1;
48 U0{2} = exp(-params.gamma*B2).*I2;