Skip to content
Snippets Groups Projects
Commit 618ccd51 authored by Bernd Flemisch's avatar Bernd Flemisch
Browse files

generalize error scripts to take an arbitrary matrix permeability

parent f59ef8aa
No related branches found
No related tags found
No related merge requests found
function [totalRelativeFractureError] = compute_1d_error( coarseFile,referenceFile ) function [totalRelativeFractureError] = compute_1d_error( coarseFile, referenceFile, kmat )
%compute1dError Evaluates the norm in each of the fractures %compute1dError Evaluates the norm in each of the fractures
% %
% The coarse file must contain a nFractures x 1 cell array with fracXAndP for % The coarse file must contain a nFractures x 1 cell array with fracXAndP for
...@@ -11,7 +11,10 @@ load(referenceFile,'p','t','x','k') ...@@ -11,7 +11,10 @@ load(referenceFile,'p','t','x','k')
load(coarseFile,'fracXAndPCell') load(coarseFile,'fracXAndPCell')
maxp = max(p); maxp = max(p);
minp = min(p); minp = min(p);
matrixIndices = find(k == 1); if nargin == 2
kmat = 1;
end
matrixIndices = find(k == kmat);
t(matrixIndices) = []; t(matrixIndices) = [];
p(matrixIndices) = []; p(matrixIndices) = [];
......
function [relativeMatrixError] = compute_2d_error( coarseFile,referenceFile ) function [relativeMatrixError] = compute_2d_error( coarseFile, referenceFile, kmat )
%compute_2d_error Evaluates the norm in the entire matrix %compute_2d_error Evaluates the norm in the entire matrix
% Detailed explanation goes here % Detailed explanation goes here
load(coarseFile,'T','P','Points') load(coarseFile,'T','P','Points')
...@@ -12,7 +12,10 @@ load(referenceFile,'t','p','x','k','domainarea') ...@@ -12,7 +12,10 @@ load(referenceFile,'t','p','x','k','domainarea')
points = x; points = x;
deltaP = max(p)-min(p); deltaP = max(p)-min(p);
fracIndices = find(k ~= 1); if nargin == 2
kmat = 1;
end
fracIndices = find(k ~= kmat);
t(fracIndices) = []; t(fracIndices) = [];
p(fracIndices) = []; p(fracIndices) = [];
nCells = length(t); nCells = length(t);
......
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