1 function s = output_functional_volume_integral(model,model_data,u)
2 %
function s = output_functional_volume_integral(model,model_data,u)
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:
9 % output(u) = int_Omega f u dx
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
17 % u is assumed to be a
function allowing a local evaluation
19 % Bernard Haasdonk 11.1.2011
21 qdeg = model.output_integral_qdeg;
22 eindices = 1:model_data.grid.nelements;
23 glob = local2global(model_data.grid, eindices, lcoord, model);
26 u.evaluate(eindices, lcoord, model_data.grid, model).* ...
27 model.output_function(glob);
29 local_int = triaquadrature(qdeg,func);
31 s = sum(local_int.*model_data.grid.A(eindices));