Skip to content
Snippets Groups Projects
Commit d3490bbd authored by Ivar Stefansson's avatar Ivar Stefansson
Browse files

Upload new file

parent e4c9b92e
No related branches found
No related tags found
No related merge requests found
function [totalRelativeFractureError] = compute_1d_error( coarseFile,referenceFile )
%compute1dError Evaluates the norm in each of the fractures
%
% The coarse file must contain a nFractures x 1 cell array with fracXAndP for
% each of the fractures, see the Description for details on how each
% fracXAndP should be constructed.
% The reference file should contain a triangulation t, point list x and
% solution vector p.
load(referenceFile,'p','t','x')
load(coarseFile,'fracXAndPCell')
nFractures = length(fracXAndPCell);
idividualRelativeFractureError = zeros(nFractures,1); %Included for comparison
% between the fractures
fractureErrorSquared = zeros(nFractures,1);
normalizationSquared = zeros(nFractures,1);
frac = true;
for i = 1:nFractures
fracXAndP = fracXAndPCell{i};
[idividualRelativeFractureError(i),fractureErrorSquared(i),normalizationSquared(i)] = ...
line_norm(fracXAndP,p,t,x,frac);
end
totalRelativeFractureError = sqrt(sum(fractureErrorSquared)/sum(normalizationSquared));
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment