rbmatlab  1.16.09
 All Classes Namespaces Files Functions Variables Modules Pages
porsche_diffusivity_tensor_components.m
1 function diff_tensor_comp=porsche_diffusivity_tensor_components(glob, params)
2 %function diff_tensor_comp=porsche_diffusivity_tensor_components(glob, params)
3 %
4 % function defining the diffusivity tensor components of the porsche_model
5 %
6 % input:
7 % - params: model
8 % - glob: n points of the microgrid (n-by-2-matrix)
9 %
10 % output:
11 % diff_tensor_comp = cell with (number of macro triangles)-by-4 entries,
12 % defining the diffusivity-tensor-components so the component-matrices of
13 % a(x) in the PDE -div( a(x) grad u(x) ) + ...
14 %
15 %
16 % for the notation of the variables in this function see also:
17 % "Reduced basis approximation and error bounds for potential
18 % flows in parametrized geometries"
19 % by Gianluigi Rozza
20 % MATHICSE Technical Report, Nr 11.2010, July 2010
21 %
22 % Oliver Zeeb, 06.05.11
23 
24 diff_tensor_comp=cell(length(params.tmacro)*4,1);
25 
26 pmic2tmac = pmicro2tmacro(glob,params);
27 q=0;
28 for k=1:length(params.tmacro)
29  pts_in_tmacro_k=find(pmic2tmac==k);
30  for l=1:4
31  q=q+1;
32  %row_position_in_matrix=repmat(l,length(pts_in_tmacro_k))
33  diff_tensor_comp{q}=sparse(pts_in_tmacro_k,l,1,length(glob),4,length(pts_in_tmacro_k));
34  end
35 end