rbmatlab  1.16.09
 All Classes Namespaces Files Functions Variables Modules Pages
eop_space_time_norm.m
Go to the documentation of this file.
1 function norm = eop_space_time_norm(fd_function1, fd_function2, grid, ~)
2 %norm = eop_space_time_norm(fd_function1, fd_function2, grid, ~)
3 %
4 % function which computes the space-time norm ||u|| = sqrt(sum_k <u^k,u^k>)
5 % with u^k a timeslice, i.e. a column of a respective function, and <.,.>
6 % being the discrete L2-SP. With two inputfuntions you compute the error
7 % ||fd_function1 - fd_function2|| and with one of them being zero you
8 % compute the norm of the other.
9 %
10 % fd_function1 and fd_function2 have to have the same size and they are
11 % assumed to be in matrix-form, i.e. one column represents the function in
12 % one timeslice.
13 %
14 % grid is for example model_data.grid
15 
16 % Dominik Garmatter 27.07 2012
17 
18 A = speye(grid.nvertices)*1/grid.nvertices; % mass matrix of the discrete L2-SP
19 C = fd_function1-fd_function2;
20 norm_build = 0;
21 
22 for i = 1:size(C,2)
23  skalarproduct = C(:,i)'*A*C(:,i);
24  norm_build = norm_build + skalarproduct;
25 end
26 norm = sqrt(norm_build);
function norm = eop_space_time_norm(fd_function1, fd_function2,gridbase grid, unused1)
norm = eop_space_time_norm(fd_function1, fd_function2, grid, ~)