| MESH toolbox 0.1 Matlab/Octave mesh utils

- Main Page
- Related Pages
- Modules
- Files

- File List
- File Members

All Files Functions Groups Pages
SortBoundary.m
Go to the documentation of this file.
1 function [bet,belt]=SortBoundary(be,bel)
2 % function [bet,belt]=SortBoundary(be,bel)
3 % Sort boundaries mesh
4
5 % start search
6 Label=unique(bel);
7
8 %Connect=zeros(2,Th.nq,'int32');
9 Connect([1 2],be(1,:))=[be(2,:);bel];
10 bet=0*be;
11 belt=0*bel;
12 i=1;
13 for l=Label % On trie le bord numero l
14 I=find(Connect(2,:)==l);
15 while (~isempty(I))
16 % [I;Connect(1,I)]
17 ideb=setdiff(I,Connect(1,I));
18 if isempty(ideb)
19 ideb=I(1);
20 end
21 for ii=ideb
22 j=ii;
23 while (Connect(2,j) == l)
24 bet(:,i)=[j;Connect(1,j)];
25 belt(i)=l;
26 Connect(2,j)=-l;
27 j=Connect(1,j);
28 i=i+1;
29 end
30 end
31 I=find(Connect(2,:)==l);
32 end
33 end