1 function r_comp = fem_rhs_boundary_part_assembly(...
2 r_int_kernel,model,df_info,elind,edgeind,with_dirichlet_deletion)
3 %
function r_comp = fem_rhs_boundary_part_assembly(...
4 % r_int_kernel,model,df_info,elind,edgeind,with_dirichlet_deletion);
6 % auxiliary
function assembling the boundary integral components of
7 % system matrix A, i.e. Neumann and Robin components
9 % note: cell-array valued kernels can be integrated.
11 % B. Haasdonk 22.2.2011
13 r_comp = zeros(df_info.ndofs,1);
14 for i = 1:df_info.nlagrange_nodes
16 for local_edge_ind = 1:3;
17 ind = find(edgeind==local_edge_ind);
18 EL = [EL; df_info.grid.EL(elind(ind),local_edge_ind)];
20 gids = df_info.global_dof_index(elind,i);
21 f = @(x) r_int_kernel(x,model,df_info,i,elind,edgeind);
25 res = res .* EL; % due to transformation formula
27 % here sparse matrix must be used to correclty handle multiple
28 % identical gids accumulatively!!!
29 r_comp_inc = sparse(gids,ones(length(gids),1),res,df_info.ndofs,1);
30 r_comp = r_comp + r_comp_inc;
34 % for first time: initialize r_comp
35 r_comp = cell(1,length(res));
37 r_comp{q} = zeros(df_info.ndofs,1);
41 res{q} = res{q} .* EL; % due to transformation formula
42 r_comp_inc = sparse(gids,ones(length(gids),1),res{q},df_info.ndofs,1);
43 r_comp{q} = r_comp{q} + r_comp_inc;
49 with_dirichlet_deletion = 1;
52 if with_dirichlet_deletion
53 if ~isempty(df_info.dirichlet_gids)
55 r_comp(df_info.dirichlet_gids) = 0;
57 for q = 1:length(r_comp)
58 r_comp{q}(df_info.dirichlet_gids) = 0;
function res = intervalquadrature(poldeg, func, varargin)
integration of function func over reference interval == unit interval. by Gaussian quadrature exactly...