spaceerror.m
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% This file is part of NS2DDV. %
% %
% Copyright(C) 2011-2018 C. Calgaro (caterina.calgaro@math.univ-lille1.fr) %
% E. Creusé (emmanuel.creuse@math.univ-lille1.fr) %
% T. Goudon (thierry.goudon@inria.fr) %
% A. Mouton (alexandre.mouton@math.univ-lille1.fr) %
% %
% NS2DDV is free software: you can redistribute it and/or modify it under the terms %
% of the GNU General Public License as published by the Free Software Foundation, %
% either version 3 of the License, or (at your option) any later version. %
% %
% NS2DDV is distributed in the hope that it will be useful, but WITHOUT ANY %
% WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A %
% PARTICULAR PURPOSE. See the GNU General Public License for more details. %
% %
% You should have received a copy of the GNU General Public License along with %
% NS2DDV. If not, see <http://www.gnu.org/licenses/>. %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function[res] = spaceerror(u, METHOD_U, uex_func, deg_intg, SPACEDIAG, MESH, PARAMETERS)
% INPUT
% u Discretized data
% METHOD_U Centering of u
% uex_func Exact function to approach
% deg_intg Gauss integration degree
% SPACEDIAG Norm of the error to compute
% MESH Mesh metadata
% PARAMETERS List of simulation parameters
%
% OUTPUT
% res Returned error
switch PARAMETERS.PARALLELIZATION.TOOLBOX
case {'PCT'}
% Use of Parallel Computing Toolbox
res = global_spaceerror_pct(u, METHOD_U, uex_func, deg_intg, SPACEDIAG, MESH);
case {'SERIAL'}
% No use of multi-processing toolbox
res = global_spaceerror_serial(u, METHOD_U, uex_func, deg_intg, SPACEDIAG, MESH);
otherwise
error(sprintf('Unknown parallelization technique.\n'));
end
end