function [G,XY] = getgraphTrianglemesh(nnod); % creates the graph of "ring" topology with (nnod) nodes: al = 0:2*pi/(nnod-1):2*pi-1e-10; XY = [cos(al),0; sin(al),0]'; b=[]; for i=1:nnod-1,b=[b,nnod];i=i+1;end G = sparse([1:nnod-1,b],[2:nnod-1,1,1:nnod-1],1,nnod,nnod); G = spones(G+G'); G = G-spdiags(diag(G),0,nnod,nnod); %G(2,8)=1;G(8,2)=1;G(4,6)=1;G(6,4)=1;