1 function U0 = init_values_wave(glob,params)
2 %
function U0 = init_values_wave(glob,params)
4 %
function constructing the initial values of the convection diffusion
5 % problem in the specified global points glob and parameters.
6 % It constructs a wave of values between 0 and c_init
7 % c_init* 0.5 * (sin(freq_x * x + freq_y * y) + 1)
9 % required fields in params:
10 % c_init : maximum value in field
11 % freq_x : frequency in x-direction
12 % freq_y : frequency in y-direction
14 % in
'coefficient' mode the model_data structure is empty
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 error('wrong number of parameters!');
28 decomp_mode = params.decomp_mode;
31 U0 = params.c_init * 0.5 * (sin(params.freq_x * glob(:,1) + ...
32 params.freq_y * glob(:,2) ) + 1 );
33 elseif decomp_mode == 1
34 % single component independent of mu_names
35 if ismember('freq_x',params.mu_names) || ...
36 ismember('freq.y',params.mu_names)
37 error('affine decomp with respect to mu_names not possible!');
39 U0 = {0.5 * (sin(params.freq_x * glob(:,1) + ...
40 params.freq_y * glob(:,2) ) + 1 )};
41 elseif decomp_mode == 2
44 error([
'decomp_mode number ', params.decomp_mode,
' is unknown.']);