rbmatlab  1.16.09
 All Classes Namespaces Files Functions Variables Modules Pages
fv_operators_zero.m
1 function [L,b] = fv_operators_zero(model,model_data, NU_ind)
2 %function [L,b] = fv_operators_zero(model,model_data[, NU_ind])
3 %
4 % function returning zero componetns, coefficients, and complete
5 % zero matrix for use if neumann/diff/conv-imlicit/explicit is to
6 % be used as zero.
7 
8 % Function supports affine decomposition, i.e. different operation modes
9 % guided by optional field decomp_mode in model. See also the
10 % contents.txt for general explanation
11 
12 % Bernard Haasdonk 13.7.2006
13 
14 % determine affine_decomposition_mode as integer
15 decomp_mode = model.decomp_mode;
16 
17 if nargin < 3
18  NU_ind = [];
19 end
20 
21 grid = [];
22 if ~isempty(model_data)
23  grid = model_data.grid;
24 end
25 
26 switch decomp_mode
27  case 2
28  L = [];
29  b = [];
30  case 1
31  L = {};
32  b = {};
33  case 0
34  n = grid.nelements;
35  if ~isempty(NU_ind)
36  m = length(NU_ind);
37  else
38  m = n;
39  end
40  L = sparse(m,n);
41  b = zeros(m,1);
42 end;
43