1 function diff_tensor_coeff=porsche_diffusivity_tensor_coefficients(glob, params)
2 %
function diff_tensor_coeff=porsche_diffusivity_tensor_coefficients(glob, params)
4 %
function defining the diffusivity tensor coefficients of the porsche_model
8 % - glob: n points of the microgrid (n-by-2-matrix)
11 % diff_tensor_coeff = (number of macro triangles)-by-4 vector, defining the diffusivity-tensor-coefficients
12 % so the coefficients a(x) in the PDE -div( a(x) grad u(x) ) + ...
15 %
for the notation of the variables in
this function see also:
16 %
"Reduced basis approximation and error bounds for potential
17 % flows in parametrized geometries"
19 % MATHICSE Technical Report, Nr 11.2010, July 2010
21 % Oliver Zeeb, 06.05.11
23 %
get the affine transformatins
for every makrotriangle:
24 % e.g. the transformation from reference to original domain.
26 % macro points of the original domain:
27 pmacro_ref=params.pmacro; % macro points of the reference domain
28 pmacro_glob = params.pmacro; % macro points of the original/global domain
29 % first points in pmacro_glob are the car points, all the others are
30 % points on the rectangular, so only the first points have to be
33 %alt: 12.05.2011, gilt so nur, wenn alle 7 punkte des models als parameter geführt werden!
34 %
for k=1:length(params.mu_names)/2
35 % x = getfield(params, params.mu_names{k});
36 % y = getfield(params, params.mu_names{k+length(params.mu_names)/2});
37 % pmacro_glob(k,:) = [x,y];
39 %neu: 12.05.11: lese alle felder aus!
40 for k=1:params.nr_macro_car_points
41 x = getfield(params, [
'x', num2str(k)]);
42 y = getfield(params, [
'y', num2str(k)]);
43 pmacro_glob(k,:) = [x,y];
46 %
get all the transformations of the macrotriangles to the
47 % reference-triangle, calculate the K-Matrices and add them to the
50 q = 1; %iteration variable
51 diff_tensor_coeff = zeros(length(params.tmacro)*4,1);
52 for k=1:length(params.tmacro)
53 tria_pts_ref = pmacro_ref(params.tmacro(k,:),:);
54 tria_pts_glob = pmacro_glob(params.tmacro(k,:),:);
55 [C, G] = aff_trafo_coef(tria_pts_ref, tria_pts_glob);
59 %define the K-matrices (see equation (6.22) )
60 % K_o,k = eyes for potential flow!
61 K=det_G*G_inv*K_o*G_inv';
64 diff_tensor_coeff(q) = K(m,l);