rbmatlab  1.16.09
 All Classes Namespaces Files Functions Variables Modules Pages
porsche_coercivity_alpha.m
1 function coercivity_alpha = porsche_coercivity_alpha(model)
2 %function coercivity_alpha = porsche_coercivity_alpha(model)
3 %
4 %
5 % function calculating a lower bound \alpha_{LB} for the coercivity
6 % constant \alpha
7 % The Lower bound is
8 % - according to "Evaluation of Flux Integral Outputs
9 % for the Reduced Basis Method" by Jens L. Eftang and Einar M. Rønquist,
10 % 2009 (equation (73)):
11 % \alpha_{LB}(\mu) = \frac{\lambda^- (\mu)}{\lambda^+(\mu)}
12 % - according to "A Reduced Basis Element Method for the Steady Stokes
13 % Problem" by Lovgren, Maday, Ronquist, 2006 (equation (3.48)):
14 % \alpha_{LB}(\mu) = \lambda_{min}
15 %
16 % Implemented here is: \alpha_{LB}(\mu) = \frac{\lambda^- (\mu)}{\lambda^+(\mu)}
17 %
18 % Oliver Zeeb, 12.05.11
19 
20 %Calculate the diffusivity matrices (K) for every macro-transformation,
21 %then calculate the eigenvalues of theses matrices. See also
22 %porsche_diffusivity_tensor_coefficients, whic does similar things, but
23 %without calculation the eigenvalues
24 
25 
26  % get the affine transformatins for every makrotriangle:
27  % e.g. the transformation from reference to original domain.
28  % macro points of the original domain:
29  pmacro_ref=model.pmacro; % macro points of the reference domain
30  pmacro_glob = model.pmacro; % macro points of the original/global domain
31  % first 7 points in pmacro_glob are the car points, all the others are
32  % points on the rectangular, so the first points have to be
33  % changed according to the values in model.mu_names
34 
35  % set the macro_points according to the values in model.mu_names
36  for k=1:length(model.mu_names)
37  position_in_pmacro = str2double(model.mu_names{k}(2));
38  x_or_y = model.mu_names{k}(1);
39  if x_or_y == 'x'
40  x_or_y = 1;
41  elseif x_or_y == 'y'
42  x_or_y = 2;
43  else
44  error('unknown entry in model.mu_names');
45  end
46 
47  mu_k = getfield(model, model.mu_names{k});
48 
49  pmacro_glob(position_in_pmacro,x_or_y) = mu_k;
50  end
51 
52 
53  % get all the transformations of the macrotriangles to the
54  % reference-triangle, calculate the K-Matrices and add them to the
55  % coefficient-vector
56  K_o = eye(2);
57  for k=1:length(model.tmacro)
58  tria_pts_ref = pmacro_ref(model.tmacro(k,:),:);
59  tria_pts_glob = pmacro_glob(model.tmacro(k,:),:);
60  [C, G] = aff_trafo_coef(tria_pts_ref, tria_pts_glob);
61  det_G=det(G);
62  G_inv = inv(G);
63 
64  %define the K-matrices (see equation (6.22) )
65  % K_o,k = eyes for potential flow!
66  K=det_G*G_inv*K_o*G_inv';
67  eigenvalue_min_K(k)=min(eig(K));
68  eigenvalue_max_K(k)=max(eig(K));
69  end
70  coercivity_alpha=min(eigenvalue_min_K)/max(eigenvalue_max_K);