1 function FNneu = neumann_values_pressure_gdl(glob,U,normals,params)
2 %
function FNneu = neumann_values_pressure_gdl(glob,U,normals,params)
4 %
function computing neuman-values by pointwise evaluation.
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
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
15 % required fields of params:
16 % params.c_neu_max : maximum flow value
for 'pressure_gdl'
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
22 % Bernard Haasdonk 3.9.2009
24 % determine affine_decomposition_mode as integer
26 % normals column check
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');
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');
43 decomp_mode = params.decomp_mode;
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;
59 error('function does not support affine decomposition!');