Changeset 3016
- Timestamp:
- 02/10/10 17:33:48 (15 years ago)
- Location:
- issm/trunk/src/m/partition
- Files:
-
- 2 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/m/partition/flagedges.m
r2919 r3016 1 function flags=flagedges(partition,adjacencymatrix);1 function [flags middles]=flagedges(x,y,partition,adjacencymatrix); 2 2 %FLAGEDGES return a vector of boolean flags that indicate whether a node is on the edge of a partition. 3 3 % needs partition vector and adjacencymatrix in inputs. 4 4 % 5 5 % 6 % Usage: flags=flagedges(partition,adjacencymatrix);6 % Usage: [flags middlegrids]=flagedges(x,y,partition,adjacencymatrix); 7 7 % 8 8 … … 12 12 %initialize flags 13 13 flags=zeros(numberofgrids,1); 14 15 middles=zeros(0,2); 14 16 15 17 %go through grids, and figure out which grid is connected to a grid belonging to another partition, flag it. … … 38 40 grids_on_edge=grids(index); 39 41 flags(grids_on_edge)=1; 40 %flags(i)=1; do not flag i, otherwise, edges are doubled, results in ugly plots. 42 flags(i)=1; 43 for j=1:length(grids_on_edge), 44 middles(end+1,:)=[(x(grids_on_edge(j))+x(i))/2 (y(grids_on_edge(j))+y(i))/2]; 45 end 41 46 end 42 47 end
Note:
See TracChangeset
for help on using the changeset viewer.