Commit a4c7787b authored by Conor McCoid's avatar Conor McCoid

Added .zip to .gitignore, created circle example for triangle intersections

parent d7cc884d
......@@ -17,3 +17,5 @@
*SA2png
*.mat
*.zip
function [N,T,Np] = CircleMesh(n,error)
ind = 0:(n-1);
N = [cos(ind*2*pi/n), 0; sin(ind*2*pi/n), 0];
T = [(n+1)*ones(n,1), mod(ind'+1,n), mod(ind'+2,n), mod(ind',n), (n+1)*ones(n,1), mod(ind'+2,n)];
T(T==0)=n;
if nargin==2 && nargout==3
r = error*rand(1)*2*pi/n;
Np= [cos(ind*2*pi/n + r), error*rand(1)-0.5*error; sin(ind*2*pi/n + r), error*rand(1)-0.5*error];
end
\ No newline at end of file
......@@ -53,13 +53,14 @@ function [P,n,M]=Intersect(X,Y)
% points on the boundary and removing duplicates at the end.
[P,Q,R,n] = Geometry(X,Y);
% figure(2)
% plot(P(1,:),P(2,:),'k^',Q(1,:),Q(2,:),'rx',R(1,:),R(2,:),'bo')
% triX = [ X , X(:,1)];
% triY = [ Y , Y(:,1)];
% hold on
% plot(triX(1,:),triX(2,:),'-',triY(1,:),triY(2,:),'-')
% hold off
% pause
% pause(1)
if size(P,2)>1 % if two or more interior points
n=[1,1,1]; % the triangle is candidate for all
end % neighbors
......@@ -71,6 +72,7 @@ if size(P,2)>0
for j=2:size(P,2)-1 % compute interface matrix
M=M+MortarInt(P(:,[1 j j+1]),X,Y);
end
figure(1)
patch(P(1,:),P(2,:),'m') % draw intersection for illustration
% H=line([P(1,:) P(1,1)],[P(2,:),P(2,1)]);
% set(H,'LineWidth',3,'Color','m');
......
[N,T,Np]=CircleMesh(20,1e-16);
figure(1)
clf
PlotMesh(N,T,'b')
PlotMesh(Np,T,'r')
M = InterfaceMatrix(N,T,Np,T);
pause(5)
% savefig('CirclePANG.fig')
clf
PlotMesh(N,T,'b')
PlotMesh(Np,T,'r')
M = InterfaceMatrixNew(N,T,Np,T);
% savefig('CircleNew.fig')
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment