Changeset 6473


Ignore:
Timestamp:
11/02/10 11:40:50 (14 years ago)
Author:
jschierm
Message:

Modified kml_part_elems.m to show actual elements in partition rather than entire group.

Location:
issm/trunk/src/m/kml
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/m/kml/kml_part_edges.m

    r6469 r6473  
    128128
    129129        [icol,irow]=find(epart'==k);
    130         if isempty(icol)
     130        if isempty(irow)
    131131            continue;
    132132        end
  • issm/trunk/src/m/kml/kml_part_elems.m

    r6469 r6473  
    123123    for k=1:md.npart
    124124
    125 %  for each partition, find all the included elements and determine the
    126 %  perimeter (including those shared by another partition)
     125%  for each partition, find all the included elements
    127126
    128127        [icol,irow]=find(epart'==k);
    129         if isempty(icol)
     128        if isempty(irow)
    130129            continue;
    131130        end
    132131        irow=unique(irow);
    133132        elem=md.elements(irow,:);
    134         nodecon=nodeconnectivity(elem,md.numberofgrids);
    135         [edgeper,elemper,iloop]=edgeperimeter(elem,nodecon);
    136         iloop(end+1)=size(edgeper,1)+1;
    137133
    138134%  determine the data to be used for the colors (if any)
     
    155151
    156152        kplace=kml_placemark();
    157         if (length(iloop)-1 > 1)
    158             kplace.name      =sprintf('Partition %d (%d loops)',k,length(iloop)-1);
    159         else
    160             kplace.name      =sprintf('Partition %d',k);
    161         end
     153        kplace.name      =sprintf('Partition %d (%d elements)',k,size(elem,1));
    162154        kplace.visibility=1;
    163155        if exist('pdata','var')
     
    176168
    177169        kmgeom=kml_multigeometry();
    178         kmgeom.geometry  ={repmat(kml_polygon(),1,length(iloop)-1)};
    179 
    180 %  loop over each loop of the perimeter for the given partition
    181 
    182         for i=1:length(iloop)-1
     170        kmgeom.geometry  ={repmat(kml_polygon(),1,size(elem,1))};
     171
     172%  loop over each element for the given partition
     173
     174        for i=1:size(elem,1)
    183175            kpoly=kml_polygon();
    184176            kpoly.extrude   =1;
     
    186178
    187179            kring=kml_linearring();
    188             kring.coords    =zeros(iloop(i+1)-iloop(i)+1,3);
    189 
    190 %  loop over the element edges on the loop of the partition
    191 
    192             for j=iloop(i):iloop(i+1)-1
    193                 [lat,long]=mapxy(md.x(edgeper(j,1)),md.y(edgeper(j,1)),'s');
    194                 kring.coords(j-iloop(i)+1,:)=[long lat alt];
     180            kring.coords    =zeros(size(elem,2)+1,3);
     181
     182%  loop over the element nodes
     183
     184            for j=1:size(elem,2)
     185                [lat,long]=mapxy(md.x(elem(i,j)),md.y(elem(i,j)),'s');
     186                kring.coords(j,:)=[long lat alt];
    195187            end
    196188            kring.coords(end,:)=kring.coords(1,:);
  • issm/trunk/src/m/kml/kml_partitions.m

    r6469 r6473  
    129129
    130130        [icol,irow]=find(epart'==k);
    131         if isempty(icol)
     131        if isempty(irow)
    132132            continue;
    133133        end
Note: See TracChangeset for help on using the changeset viewer.