1 function res = matrix_robin(x, model, df_info, i, j, elind, edgeind)
2 %
function res = matrix_robin(x, model, df_info, i, j, elind, edgeind)
4 % auxiliary
function for integral kernel
for A_robin
5 % integral kernel on all robin-edges simultaneously
6 % here x is a scalar value on unit interval
7 % f(x) = (alpha/beta + b^T n) hatphi_i hatphi_j
8 % multiplication with |edge| is realized in caller after
10 % This
function can handle cell-array valued data
12 % B. Haasdonk 22.2.2011
17 for local_edge_id = 1:3
18 lcoord = llocal2local(grid,local_edge_id,x); % local coord
for x on edge 1
19 hat_phi_i = evaluate_basis_function(df_info,lcoord,i);
20 hat_phi_j = evaluate_basis_function(df_info,lcoord,j);
21 elinds = elind(edgeind==local_edge_id);
23 if model.decomp_mode == 0
24 res = [res; (model.robin_beta(grid,elinds,local_edge_id,x, ...
26 model.robin_alpha(grid,elinds,local_edge_id,x, ...
27 model) * hat_phi_i * hat_phi_j ];
29 % number of components = 1
35 ( (model.robin_beta(grid,elinds,local_edge_id,x, ...
37 model.robin_alpha(grid,elinds,local_edge_id,x, ...
39 ) * hat_phi_i * hat_phi_j ]; % local model!
42 if model.has_advection
44 xmodel.velocity(grid, xelind, ...
46 elinds, lcoord, model);
49 res(end-numel(elinds)+1:end) ...
50 = res(end-numel(elinds)+1:end) ...
51 + ( b(:,1) .* grid.NX(elinds,local_edge_id) ...
52 + b(:,2) .* grid.NY(elinds,local_edge_id) ...
53 ) * hat_phi_i * hat_phi_j; % local model!
54 else % iscell => components mode
56 % number of components = 1+ Q_velocity y
57 if numel(res) < length(b)+1
58 res = [res, cell(1,length(b))];
60 res{q+1} = zeros(0,1);
65 res{q+1} = [res{q+1};...
66 ( b{q}(:,1).*grid.NX(elinds,local_edge_id) ...
67 + b{q}(:,2).*grid.NY(elinds,local_edge_id) ...
68 ) * hat_phi_i * hat_phi_j; ...
74 end %model.has_advection
function varargout = cache_function(func_ptr, varargin)
simple caching of function call inputs are cached too!