Changeset 3016


Ignore:
Timestamp:
02/10/10 17:33:48 (15 years ago)
Author:
Eric.Larour
Message:

partitioner: wrap chaco, scotch, metis
adjacency: faster computation of adjacency.

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);
     1function [flags middles]=flagedges(x,y,partition,adjacencymatrix);
    22%FLAGEDGES return a vector of boolean flags that indicate whether a node is on the edge of a partition.
    33%          needs partition vector and adjacencymatrix in inputs.
    44%
    55%
    6 %         Usage: flags=flagedges(partition,adjacencymatrix);
     6%         Usage: [flags middlegrids]=flagedges(x,y,partition,adjacencymatrix);
    77%
    88
     
    1212%initialize flags
    1313flags=zeros(numberofgrids,1);
     14
     15middles=zeros(0,2);
    1416
    1517%go through grids, and figure out which grid is connected to a grid belonging to another partition, flag it.
     
    3840                grids_on_edge=grids(index);
    3941                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
    4146        end
    4247end
Note: See TracChangeset for help on using the changeset viewer.