Changeset 12576


Ignore:
Timestamp:
06/28/12 08:11:10 (13 years ago)
Author:
Mathieu Morlighem
Message:

Fixed modelextract for edges

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/m/model/modelextract.m

    r11142 r12576  
    166166        if size(md2.mesh.edges,2)>1, %do not use ~isnan because there are some NaNs...
    167167                %renumber first two columns
    168                 pos=find(~isnan(md2.mesh.edges(:,4)));
     168                pos=find(md2.mesh.edges(:,4)~=-1);
    169169                md2.mesh.edges(:  ,1)=Pnode(md2.mesh.edges(:,1));
    170170                md2.mesh.edges(:  ,2)=Pnode(md2.mesh.edges(:,2));
     
    173173                %remove edges when the 2 vertices are not in the domain.
    174174                md2.mesh.edges=md2.mesh.edges(find(md2.mesh.edges(:,1) & md2.mesh.edges(:,2)),:);
    175                 %Replace all zeros by NaN in the last two columns;
     175                %Replace all zeros by -1 in the last two columns;
    176176                pos=find(md2.mesh.edges(:,3)==0);
    177                 md2.mesh.edges(pos,3)=NaN;
     177                md2.mesh.edges(pos,3)=-1;
    178178                pos=find(md2.mesh.edges(:,4)==0);
    179                 md2.mesh.edges(pos,4)=NaN;
    180                 %Invert NaN of the third column with last column (Also invert first two columns!!)
    181                 pos=find(isnan(md2.mesh.edges(:,3)));
     179                md2.mesh.edges(pos,4)=-1;
     180                %Invert -1 on the third column with last column (Also invert first two columns!!)
     181                pos=find(md2.mesh.edges(:,3)==-1);
    182182                md2.mesh.edges(pos,3)=md2.mesh.edges(pos,4);
    183                 md2.mesh.edges(pos,4)=NaN;
     183                md2.mesh.edges(pos,4)=-1;
    184184                values=md2.mesh.edges(pos,2);
    185185                md2.mesh.edges(pos,2)=md2.mesh.edges(pos,1);
    186186                md2.mesh.edges(pos,1)=values;
    187187                %Finally remove edges that do not belong to any element
    188                 pos=find(isnan(md2.mesh.edges(:,3)) & isnan(md2.mesh.edges(:,4)));
     188                pos=find(md2.mesh.edges(:,3)==-1 & md2.mesh.edges(:,4)==-1);
    189189                md2.mesh.edges(pos,:)=[];
    190190        end
Note: See TracChangeset for help on using the changeset viewer.