1 function v = fem_operators_output_boundary_integral(model,model_data)
2 %
function v = fem_operators_output_boundary_integral(model,model_data)
4 %
function computing the output vectors of an elliptic problem with
5 % finite element discretization and output functional consisting of
6 % a weighted boundary integral
8 % `s(u) = \int_{\partial \Omega} f(x) u(x)`
10 % required fields of model:
11 % output_function: weight function `f`
12 % decomp_mode: decision about the mode to be performed
13 % components, coefficients or complete
15 % B. Haasdonk 22.2.2011
17 if model.decomp_mode == 2 % == 2 coefficients
18 v = model.output_function([],model);
20 % select all boundary elements for integration
21 i = find(model_data.grid.NBI(:)<0);
22 [elind,edgeind] = ind2sub(size(model_data.grid.NBI),i);
23 % turn off dirichlet deletion:
24 with_dirichlet_deletion = 0;
26 v = fem_rhs_boundary_part_assembly(...
27 @bnd_output_int_kernel,model,model_data.df_info,...
28 elind,edgeind,with_dirichlet_deletion);
31 %%%%%%%%%%%%%%%%%%%%% boundary integral kernel
32 function res = bnd_output_int_kernel(x,model,df_info,i,elind,edgeind)
33 % here x is a scalar value on unit interval
34 % f(x) = output_function * hatphi_i
35 % multiplication with |edge| is realized in caller after quadrature.
36 % function can handle cell-array valued data
37 % this function is 99% identical to fem_rhs_neumann_integral_kernel
38 % perhaps merge sometime.
40 for local_edge_id = 1:3
41 lcoord = llocal2local(...
42 df_info.grid,local_edge_id,x); % local coord for x on edge 1
43 hat_phi_i = fem_evaluate_basis_function(df_info,lcoord,i);
44 inds = find(edgeind==local_edge_id);
45 glob = local2global(df_info.grid,elind(inds),lcoord);
46 w = model.output_function(glob,model);
53 res = cell(1,length(w));