rbmatlab  1.16.09
 All Classes Namespaces Files Functions Variables Modules Pages
fem_rhs_neumann_integral_kernel.m
1 function res = fem_rhs_neumann_integral_kernel(x,model,df_info,i,neumann_elind,neumann_edgeind);
2 %function res = fem_rhs_neumann_integral_kernel(x,model,df_info,i,neumann_elind,neumann_edgeind);
3 %
4 % auxiliary function for integral kernel for r_neumann
5 % integral kernel on all neumann-edges simultaneously
6 % here x is a scalar value on unit interval
7 % f(x) = g_N * hatphi_i
8 % multiplication with |edge| is realized in caller after quadrature.
9 % function can handle cell-array valued data
10 
11 % B. Haasdonk 22.2.2011
12 % I. Maier 24.03.2011
13 
14 res = zeros(0,1);
15 for local_edge_id = 1:3
16  lcoord = llocal2local(df_info.grid,local_edge_id,x); % local coord for x on edge 1
17  hat_phi_i = fem_evaluate_basis_function(df_info,lcoord,i);
18  inds = find(neumann_edgeind==local_edge_id);
19  g_N = model.neumann_values(df_info.grid,neumann_elind(inds), ...
20  local_edge_id,x,model); % local model!
21  if ~iscell(g_N)
22  res = [res;...
23  g_N * hat_phi_i; ...
24  ];
25  else
26  if ~iscell(res)
27  res = cell(1,length(g_N));
28  for q = 1:length(g_N)
29  res{q} = zeros(0,1);
30  end;
31  end;
32  for q = 1:length(g_N)
33  res{q} = [res{q};...
34  g_N{q} * hat_phi_i; ...
35  ];
36  end;
37  end;
38 end;
39