1 function FNneu = neumann_values_outflow(glob,U,normals,params)
2 %
function FNneu = neumann_values_outflow(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 % FNneu = F(Uneu, Xneu, Yneu) * n
12 % Function supports affine decomposition, i.e. different operation modes
13 % guided by optional field decomp_mode in params. See also the
14 % contents.txt for general explanation
16 % Bernard Haasdonk 3.9.2009
18 % determine affine_decomposition_mode as integer
20 % normals column check
22 if ~isempty(normals) && size(glob,1) < size(glob,2)
23 warning('coordinates in variable normals are given row-wise, but expected them to be column-wise');
30 if ~isempty(glob) && size(glob,1) < size(glob,2)
31 warning('coordinates in variable glob are given row-wise, but expected them to be column-wise');
37 decomp_mode = params.decomp_mode;
39 Fneu = params.conv_flux_ptr(glob,U,params);
41 FNneu = Fneu(:,1) .* normals(:,1) + Fneu(:,2) .* normals(:,2);
42 elseif decomp_mode == 1
43 Q_Fneu = length(Fneu);
44 FNneu = cell(Q_Fneu,1);
45 FNneu{:} = zeros(size(glob,1),1);
47 FNneu{q} = Fneu{q}(:,1).*normals(:,1) + Fneu{q}(:,2).*normals(:,2);
50 % error(
'Not sure what to do in this case.')
51 FNneu = Fneu; % perhaps this is right?