1 function U0 = init_values_transformed_blobs_richards(glob,params)
2 %
function U0 = init_values_transformed_blobs_richards(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
13 % gravity: physical gravity
14 % hill_height: geometry parameter
for hill of upper gemeotries
' boundary
16 % in 'coefficient
' mode the model_data structure is empty
18 % Martin Drohmann 23.9.2009
22 if ~isempty(glob) && size(glob,1) < size(glob,2)
23 warning('coordinates in variable glob are given row-wise, but expected them to be column-wise
');
29 decomp_mode = params.decomp_mode;
31 if any(ismember(fieldnames(params), 'blob_height
'))
32 h = params.blob_height;
38 U0 = [ h, h, h, h, h, h, h, params.c_init];
39 U0 = [ U0, params.gravity, params.gravity * params.hill_height ];
43 B{1} = ((X(:) - 0.5).^2 +(Y(:)-0.7).^2);
44 B{2} = ((X(:) - 0.8).^2 +(Y(:)-0.9).^2);
45 B{3} = ((X(:) - 0.8).^2 +(Y(:)-0.2).^2);
46 B{4} = ((X(:) - 0.2).^2 +(Y(:)-0.2).^2);
47 B{5} = ((X(:) - 0.2).^2 +(Y(:)-0.9).^2);
48 B{6} = ((X(:) - 0.4).^2 +(Y(:)-0.4).^2);
49 B{7} = ((X(:) - 0.6).^2 +(Y(:)-0.6).^2);
53 % p_mu = spline_select(params);
55 I{i} = (B{i} < 0.05.^2);
58 U0 = h .* I{1} + params.c_init * ones(length(X),1);
59 % TODO: replace ztrans with something derivated from myspline
62 U0 = U0 + params.gravity * (Y + params.hill_height*ztrans);
65 U0 = U0 + h .* exp(-B{i}) .* I{i};
67 elseif decomp_mode == 1
74 U0{8} = ones(length(X),1);
78 error(['decomp_mode number
' params.decomp_mode, ' is unknown.
']);