4 %
function applying an FV-space-discretization
operator starting from old
5 % values U corresponding to the geometry given in grid producing a
6 %
new vector of elementwise scalars NU but only on
for the
7 % subelements with numbers given in NU_ind. If NU_ind is empty, all
8 %
new values NU are determined, i.e. length(NU) = length(U) = grid.nelements
10 % By
this, the
operator evaluation can be performed in a localized
11 % way, i.e. used
for empirical interpolation in rb_nonlin_evol_simulation
13 % usual timestepping can be performed afterwards by (NU = Id - deltat * INC).
15 % required fields of params:
18 % Bernard Haasdonk 18.5.2007
20 % compute flux at dirichlet and inner edges. Neuman and
21 % cut-edges are not set.
23 %disp(
'step through fv_conv_explicit_space!!');
26 num_flux = fv_num_conv_flux(U,grid,params);
27 num_flux_mat = num_flux.G;
29 %
if no subset is specified: compute all elements
31 NU_ind = 1:grid.nelements;
38 neu_NB_ind =find(grid.NBI == -2);
39 UU = repmat(U,1,grid.nneigh);
41 % determine neumann-boundary values at end as computed flux is required
42 % in case of outflow-conditions
43 if ~isempty(neu_NB_ind)
45 % in case of file access, the correct filename must be set here
46 % the following is only relevant in case of use of a
47 % params.use_velocitymatrix_file and filecaching mode 2
48 if isfield(params,'filecache_velocity_matrixfile_extract') && ...
49 (params.filecache_velocity_matrixfile_extract == 2);
50 params.velocity_matrixfile = ...
51 cache_velocity_matrixfile_extract(...
52 grid.ECX(neu_NB_ind),...
53 grid.ECY(neu_NB_ind),...
58 FNneu = neuman_values( ...
59 grid.ECX(neu_NB_ind),...
60 grid.ECY(neu_NB_ind),...
62 grid.NX(neu_NB_ind),...
63 grid.NY(neu_NB_ind), ...
66 % set overall neumann boundary values
67 num_flux_mat(neu_NB_ind) = grid.EL(neu_NB_ind) .* FNneu;
70 % for to_be_computed elements, we need all fluxes!
71 i = find(isnan(num_flux_mat(NU_ind,:)),1);
73 error('not all fluxes specified, NaN occuring !!');
76 %NU = U(NU_ind) - params.dt * grid.Ainv(NU_ind) .* ...
77 % sum( num_flux_mat(NU_ind), 2);
78 INC = grid.Ainv(NU_ind) .* sum( num_flux_mat(NU_ind,:), 2);
81 % plot_fv_data([U,NU],params,'U(n) and U(n+1)');
84 % TO BE ADJUSTED TO NEW SYNTAX
function r = verbose(level, message, messageId)
This function displays messages depending on a message-id and/or a level. Aditionally you can set/res...
function INC = fv_conv_explicit_space(U, NU_ind,gridbase grid, params)
fv_conv_explicit_space(U,NU_ind,grid,params) function applying an FV-space-discretization operator st...