rbmatlab  1.16.09
 All Classes Namespaces Files Functions Variables Modules Pages
fem_rhs_robin_integral_kernel.m
1 function res = fem_rhs_robin_integral_kernel(x,model,df_info,i,robin_elind,robin_edgeind);
2 %function res = fem_rhs_robin_integral_kernel(x,model,df_info,i,robin_elind,robin_edgeind);
3 %
4 % auxiliary function for integral kernel for r_robin
5 % integral kernel on all robin-edges simultaneously
6 % here x is a scalar value on unit interval
7 % f(x) = g_R/beta * 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(robin_edgeind==local_edge_id);
19  beta = model.robin_beta(df_info.grid,robin_elind(inds),local_edge_id,x,model); % local model!
20  g_R = model.robin_values(df_info.grid,robin_elind(inds),local_edge_id,x,model); % local model!
21  if ~iscell(g_R)
22  res = [res;...
23  (beta.^(-1)).*g_R * hat_phi_i; ...
24  ];
25  else % iscell!!
26  if ~iscell(res)
27  res = cell(1,length(g_R));
28  for q = 1:length(g_R);
29  res{q} = zeros(0,1);
30  end;
31  end;
32  for q = 1:length(g_R)
33  res{q} = [res{q};...
34  (beta.^(-1)).*g_R{q} * hat_phi_i; ...
35  ];
36  end;
37  end;
38 end;
39