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

Delete divideTriangulation.m

parent 75070fbf
No related branches found
No related tags found
No related merge requests found
load SNPI_Bernd_raw.mat;
% saved in importerref.m. Contains points, pressure and triangulation,
% named x, p and t respectively.
f = t(:,4)~=0;
th = ~f;
% last letter "t" for three, "f" for four
pt = p(th);
pf = p(f);
toldt = t(th, 1:3);
toldf = t(f, :);
[uniquet, intoldt, inuniquet] = unique(toldt);
[uniquef, ~, inuniquef] = unique(toldf);
xt = x(uniquet,:);
xf = x(uniquef,:);
% tnewt = zeros(size(toldt));
% tnewf = zeros(size(toldf));
%these sets of loops might perhaps be avoided by some "unique-trick". Might
%reduce run time significantly
% for i = 1:length(toldt)
% for j = 1:3
% tnewt(i,j)=find(uniquet==toldt(i,j));
% end
% end
tnewt = reshape(inuniquet, size(toldt));
tnewf = reshape(inuniquef, size(toldf));
% for i = 1:length(toldf)
% for j = 1:4
% tnewf(i,j)=find(uniquef==toldf(i,j));
% end
% end
%tt = triangulation(tnewt,xt);
%can't use triangulation on the quads, so connectivity list and points are
% saved seperately.
clF = tnewf;
%save('E:\Comparison paper\Mortar\SNPI_Bref', ...
% 'clF', 'xf', 'tt', 'pf', 'pt');
Xt = xt(tnewt);
yt = xt(:,2);
Yt = yt(tnewt);
Xf = xf(tnewf);
yf = xf(:,2);
Yf = yf(tnewf);
midt = [sum(Xt,2)/3, sum(Yt,2)/3];
areat = polyarea(Xt, Yt, 2);
midf = [sum(Xf,2)/4, sum(Yf,2)/4];
areaf = polyarea(Xf, Yf, 2);
cc = [midt;midf];
a = [areat;areaf];
p = [pt; pf];
save('C:\Users\Ivar\Desktop\L2norm\SNPI_reference_values', 'cc','a','p')
\ No newline at end of file
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