1 function L = ldg_numerical_flux_operator_fct(lcoord,grid,params)
2 %
function L = ldg_analytical_flux_operator_fct(lcoord,grid,params)
4 %
function returning the integrand of the analytical flux integral
5 % evaluated in local coordinates lcoord.
7 % in
'components' mode, a 4 dimensional dense matrix is generated
8 % L(i,j,e,q) = v^q (lcoord) * JIT* grad phi_e_i(lcoord) phi_e_j (lcoord)
10 % i.e. i and j local base function indices, e the element index and
11 % q the component number.
13 % in 'complete' mode, the above Q = Q_v components are weighted
14 % with Theta_v^q(mu), i.e. identical coefficients as velocity.
15 % result is a 3 dimensional matrix
16 % L(i,j,e) = v (lcoord) * JIT* grad phi_e_i(lcoord) phi_e_j (lcoord)
19 % triaquad of this function should give the desired result used in
20 % ldg_operaotors_adv_explicit
22 % Bernard Haasdonk 31.8.2009
24 disp('to be adjusted!!');
27 decomp_mode = params.decomp_mode;
30 error('currently only scalar valued implementation supported');
33 L = params.velocity_coefficients_fct(params);
35 % evaluate reference basis in lcoord
36 Phi_hats = ldg_evaluate_basis(lcoord,params);
37 nbasefct = size(Phi_hats,2);
38 nelements = grid.nelements;
39 Phi_hats_derivative = ldg_evaluate_basis_derivative(lcoord,params);
40 % extrude Phi_hats_derivative to all elements
41 Phi_hats_derivative = reshape([Phi_hats_derivative{:}],2, ...
43 Phi_hats_derivative = repmat(Phi_hats_derivative,1,grid.
nelements);
44 JIT = repmat(grid.
JIT(:)
',nbasefct,1);
45 JIT = reshape(JIT,nbasefct*nelements,2,2);
47 % multiply Phi_hats_derivative with JIT (JacobianInverseTransposed)
48 Phi_derivative_x = JIT(:,1,1)*Phi_hats_derivative(1,:) ...
49 + JIT(:,1,2)*Phi_hats_derivative(2,:);
50 Phi_derivative_y = JIT(:,2,1)*Phi_hats_derivative(1,:) ...
51 + JIT(:,2,2)*Phi_hats_derivative(2,:);
52 Phi_derivative = [Phi_derivative_x; Phi_derivative_y];
54 % evaluate velocity in lcoord
55 v = params.velocity_ptr(...
56 local2global(grid,1:grid.nelements,lcoord,params), params);
60 L = zeros(nbasefct, nbasefct, nelements, Q_v);
62 % extrude v_q, such that simple componentwise multiplication
63 % with others is possible
64 vq = repmat(v{q}(:),1,nbasefct);
65 vq = reshape(vq,2,nbasefct*nelements);
66 % sort results into L: First v * grad Phi_e_i in identical columns
67 L0 = v(1,:).*Phi_derivative(1,:)+ v(2,:).*Phi_derivative(2,:);
68 L0 = reshape(L0,[nbasefct,1,nelements]);
69 Lq = repmat(L0,1,nbasefct,1);
70 % then multiply with phi_e_j
72 L(:,j,:,q) = Lq(:,j,:).*Phi_hats(:,j);
76 else % decomp_mode = 0 === "complete"
78 % extrude v_q, such that simple componentwise multiplication
79 % with others is possible
80 v = repmat(v(:),1,nbasefct);
81 v = reshape(v,2,nbasefct*nelements);
82 % sort results into L: First v * grad Phi_e_i in identical columns
83 L0 = v(1,:).*Phi_derivative(1,:)+ v(2,:).*Phi_derivative(2,:);
84 L0 = reshape(L0,[nbasefct,1,nelements]);
85 L = repmat(L0,1,nbasefct,1);
86 % then multiply with phi_e_j
88 L(:,j,:) = L(:,j,:).*Phi_hats(:,j);
nelements
number of overall elements (leaf + nonleaf)
JIT
Jacobian inverse transposed JIT(i,:,:) is a 2x2-matrix of the Jacobian Inverse Transposed on element ...