rbmatlab  1.16.09
 All Classes Namespaces Files Functions Variables Modules Pages
output_functional_volume_integral.m
1 function s = output_functional_volume_integral(model,model_data,u)
2 %function s = output_functional_volume_integral(model,model_data,u)
3 %
4 % function computing an output functional from the discrete
5 % function U. Grid is needed to have the space discretization
6 % information about U. A linear output function of the form of a
7 % volume integral is computed:
8 %
9 % output(u) = int_Omega f u dx
10 %
11 % required fields of model:
12 % output_function : pointer to function f,
13 % e.g. output_function_box_mean.m
14 % computing the weight function f of the integral
15 % output_integral_qdeg : degree of output integral computation
16 %
17 % u is assumed to be a function allowing a local evaluation
18 
19 % Bernard Haasdonk 11.1.2011
20 
21 qdeg = model.output_integral_qdeg;
22 eindices = 1:model_data.grid.nelements;
23 glob = local2global(model_data.grid, eindices, lcoord, model);
24 
25 func = @(lcoord) ...
26  u.evaluate(eindices, lcoord, model_data.grid, model).* ...
27  model.output_function(glob);
28 
29 local_int = triaquadrature(qdeg,func);
30 
31 s = sum(local_int.*model_data.grid.A(eindices));
32 
33