1 function f = output_function_box_mean(glob,params)
2 %
function f = output_function_box_mean(glob,params)
4 %
function computing the integral kernel of a linear output
5 % functional given as integral:
7 % output(u) = int_Omega f u dx
9 % the
function f is represented by
this function, the integration
10 % performed in suitable discretization routines later, e.g.
12 % global coordinate vectors. Res is a matrix with columnwise
13 % results of application of f on all columns of glob.
15 % box_mean:
for computation of mean(U) over box specified by
16 % params, i.e. f indicator function of the box scaled with the
17 % inverse volume of the box.
19 % note, that this functional is only exact, if the boundary of the
20 % box is exaclty corresponding ot element boundarys of the
23 % required fields of params:
24 % sbox_xmin, sbox_xmax sbox_ymin, sbox_ymax: coordinates of the
25 % box over which averaging is performed.
27 % These parameters should not be under parameter variation control,
28 % but be constant throughout the parameter variation.
31 if ~isempty(glob) && size(glob,1) < size(glob,2)
32 warning('coordinates in variable glob are given row-wise, but expected them to be column-wise');
39 % Bernard Haasdonk 16.5.2008
41 decomp_mode = params.decomp_mode;
44 f = 1; % one component weight 1, i.e. no parametrization
47 boxvolinv = 1/((params.sbox_xmax-params.sbox_xmin)*...
48 (params.sbox_ymax-params.sbox_ymin));
50 I = (glob(:,1)<=params.sbox_xmax) & (glob(:,1)>=params.sbox_xmin) ...
51 & (glob(:,2)>=params.sbox_ymin) & (glob(:,2)<=params.sbox_ymax);
53 % I2 = (glob(:,1)>=params.sbox_xmin) & (glob(:,1)<=params.sbox_xmax) & ...
54 % (glob(:,2)<=params.sbox_ymax) & (glob(:,2)>=params.sbox_ymin);
56 % I3 = (glob(:,1)<=params.sbox_xmax) & (glob(:,1)>=params.sbox_xmin) ...
57 % & (glob(:,2)<=params.sbox_ymax) & (glob(:,2)>=params.sbox_ymin);
61 % function simply is 0 if glob is not in the box,
62 % 1/vol(box) if glob is in the box.
65 if decomp_mode == 1 % single component in cell array
67 else % decomp_mode == 0
function [ v , l2norm ] = fv_operators_output(model, model_data)
function returning components, coefficients, and complete operator for a linear output functional on ...