rbmatlab  1.16.09
 All Classes Namespaces Files Functions Variables Modules Pages
neumann_values_pressure_gdl.m
1 function FNneu = neumann_values_pressure_gdl(glob,U,normals,params)
2 %function FNneu = neumann_values_pressure_gdl(glob,U,normals,params)
3 %
4 % function computing neuman-values by pointwise evaluation.
5 %
6 % glob: columnwise coordinate vectors of global points to be evaluated
7 % Uneu: columnwise U values in points in case of a u-dependent flux
8 % normals: Columnwise corresponding unit normal vectors
9 %
10 % FNeu = no_flow on upper and lower boundary. left and
11 % right is a parabolic velocity profile with maximum params.c_neu_max.
12 % Uneu and Nxneu and Nyneu may be ignored.
13 % 'rightflow': outflow to right, noflow to upper and lower
14 %
15 % required fields of params:
16 % params.c_neu_max : maximum flow value for 'pressure_gdl'
17 %
18 % Function supports affine decomposition, i.e. different operation modes
19 % guided by optional field decomp_mode in params. See also the
20 % contents.txt for general explanation
21 
22 % Bernard Haasdonk 3.9.2009
23 
24 % determine affine_decomposition_mode as integer
25 % glob column check
26 % normals column check
27 if params.debug
28  if ~isempty(normals) && size(glob,1) < size(glob,2)
29  warning('coordinates in variable normals are given row-wise, but expected them to be column-wise');
30  if params.debug > 2
31  keyboard;
32  end
33  end
34 end
35 if params.debug
36  if ~isempty(glob) && size(glob,1) < size(glob,2)
37  warning('coordinates in variable glob are given row-wise, but expected them to be column-wise');
38  if params.debug > 2
39  keyboard;
40  end
41  end
42 end
43 decomp_mode = params.decomp_mode;
44 
45 % set all to zero
46 FNneu = zeros(size(glob,1),1);
47 % left boundary negative velocity -> positive pressure gradient
48 i = find(glob(:,1)<params.xrange(1)+eps);
49 FNneu(i) = params.c_neu_max * ...
50  (params.yrange(2)-params.yrange(1))^(-2) * ...
51  (glob(i,2)-params.yrange(1)).*(params.yrange(2)-glob(i,2))*4;
52 % right boundary positive velocity -> negative pressure gradient
53 i = find(glob(:,1)>params.xrange(2)-eps);
54 FNneu(i) = -params.c_neu_max * ...
55  (params.yrange(2)-params.yrange(1))^(-2) * ...
56  (glob(i,2)-params.yrange(1)).*(params.yrange(2)-glob(i,2))*4;
57 
58 if decomp_mode>0
59  error('function does not support affine decomposition!');
60 end;
61 
62 %| \docupdate