Changeset 12576
- Timestamp:
- 06/28/12 08:11:10 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/m/model/modelextract.m
r11142 r12576 166 166 if size(md2.mesh.edges,2)>1, %do not use ~isnan because there are some NaNs... 167 167 %renumber first two columns 168 pos=find( ~isnan(md2.mesh.edges(:,4)));168 pos=find(md2.mesh.edges(:,4)~=-1); 169 169 md2.mesh.edges(: ,1)=Pnode(md2.mesh.edges(:,1)); 170 170 md2.mesh.edges(: ,2)=Pnode(md2.mesh.edges(:,2)); … … 173 173 %remove edges when the 2 vertices are not in the domain. 174 174 md2.mesh.edges=md2.mesh.edges(find(md2.mesh.edges(:,1) & md2.mesh.edges(:,2)),:); 175 %Replace all zeros by NaNin the last two columns;175 %Replace all zeros by -1 in the last two columns; 176 176 pos=find(md2.mesh.edges(:,3)==0); 177 md2.mesh.edges(pos,3)= NaN;177 md2.mesh.edges(pos,3)=-1; 178 178 pos=find(md2.mesh.edges(:,4)==0); 179 md2.mesh.edges(pos,4)= NaN;180 %Invert NaN ofthe 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); 182 182 md2.mesh.edges(pos,3)=md2.mesh.edges(pos,4); 183 md2.mesh.edges(pos,4)= NaN;183 md2.mesh.edges(pos,4)=-1; 184 184 values=md2.mesh.edges(pos,2); 185 185 md2.mesh.edges(pos,2)=md2.mesh.edges(pos,1); 186 186 md2.mesh.edges(pos,1)=values; 187 187 %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); 189 189 md2.mesh.edges(pos,:)=[]; 190 190 end
Note:
See TracChangeset
for help on using the changeset viewer.