Changeset 22931
- Timestamp:
- 07/13/18 14:16:01 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/m/exp/contourlevelzero.m
r21824 r22931 16 16 x=md.mesh.x; 17 17 y=md.mesh.y; 18 if isfield(md.mesh,'z'), 19 z=md.mesh.z; 20 else 21 z=zeros(md.mesh.numberofvertices,1); 22 end 18 23 index=md.mesh.elements; 19 24 … … 82 87 y1=zeros(numelems,1); 83 88 y2=zeros(numelems,1); 89 z1=zeros(numelems,1); 90 z2=zeros(numelems,1); 91 84 92 edge_l=zeros(numelems,2); 85 93 … … 96 104 y1(j)=y(Seg1(poselem(j),1))+weight1*(y(Seg1(poselem(j),2))-y(Seg1(poselem(j),1))); 97 105 y2(j)=y(Seg2(poselem(j),1))+weight2*(y(Seg2(poselem(j),2))-y(Seg2(poselem(j),1))); 106 z1(j)=z(Seg1(poselem(j),1))+weight1*(z(Seg1(poselem(j),2))-z(Seg1(poselem(j),1))); 107 z2(j)=z(Seg2(poselem(j),1))+weight2*(z(Seg2(poselem(j),2))-z(Seg2(poselem(j),1))); 108 98 109 edge_l(j,1)=Seg1_num(poselem(j)); 99 110 edge_l(j,2)=Seg2_num(poselem(j)); … … 105 116 y1(j)=y(Seg1(poselem(j),1))+weight1*(y(Seg1(poselem(j),2))-y(Seg1(poselem(j),1))); 106 117 y2(j)=y(Seg3(poselem(j),1))+weight3*(y(Seg3(poselem(j),2))-y(Seg3(poselem(j),1))); 118 z1(j)=z(Seg1(poselem(j),1))+weight1*(z(Seg1(poselem(j),2))-z(Seg1(poselem(j),1))); 119 z2(j)=z(Seg3(poselem(j),1))+weight3*(z(Seg3(poselem(j),2))-z(Seg3(poselem(j),1))); 120 107 121 edge_l(j,1)=Seg1_num(poselem(j)); 108 122 edge_l(j,2)=Seg3_num(poselem(j)); … … 114 128 y1(j)=y(Seg2(poselem(j),1))+weight2*(y(Seg2(poselem(j),2))-y(Seg2(poselem(j),1))); 115 129 y2(j)=y(Seg3(poselem(j),1))+weight3*(y(Seg3(poselem(j),2))-y(Seg3(poselem(j),1))); 130 z1(j)=z(Seg2(poselem(j),1))+weight2*(z(Seg2(poselem(j),2))-z(Seg2(poselem(j),1))); 131 z2(j)=z(Seg3(poselem(j),1))+weight3*(z(Seg3(poselem(j),2))-z(Seg3(poselem(j),1))); 132 116 133 edge_l(j,1)=Seg2_num(poselem(j)); 117 134 edge_l(j,2)=Seg3_num(poselem(j)); … … 130 147 %take the right edge of the second segment and connect it to the next segments if any 131 148 e1=edge_l(1,1); e2=edge_l(1,2); 132 xc=[x1(1);x2(1)]; yc=[y1(1);y2(1)]; 149 xc=[x1(1);x2(1)]; yc=[y1(1);y2(1)]; zc=[z1(1);z2(1)]; 150 133 151 134 152 %erase the lines corresponding to this edge … … 136 154 x1(1)=[]; x2(1)=[]; 137 155 y1(1)=[]; y2(1)=[]; 156 z1(1)=[]; z2(1)=[]; 138 157 139 158 [ro1,co1]=find(edge_l==e1); … … 142 161 143 162 if co1==1, 144 xc=[x2(ro1);xc]; yc=[y2(ro1);yc]; 163 xc=[x2(ro1);xc]; yc=[y2(ro1);yc];zc=[z2(ro1);zc]; 145 164 146 165 %next edge: … … 148 167 149 168 else 150 xc=[x1(ro1);xc]; yc=[y1(ro1);yc]; 169 xc=[x1(ro1);xc]; yc=[y1(ro1);yc];zc=[z1(ro1);zc]; 151 170 152 171 %next edge: … … 158 177 x1(ro1)=[]; x2(ro1)=[]; 159 178 y1(ro1)=[]; y2(ro1)=[]; 179 z1(ro1)=[]; z2(ro1)=[]; 160 180 161 181 %next connection … … 169 189 170 190 if co2==1, 171 xc=[xc;x2(ro2)]; yc=[yc;y2(ro2)]; 191 xc=[xc;x2(ro2)]; yc=[yc;y2(ro2)];zc=[zc;z2(ro2)]; 172 192 173 193 %next edge: 174 194 e2=edge_l(ro2,2); 175 195 else 176 xc=[xc;x1(ro2)]; yc=[yc;y1(ro2)]; 196 xc=[xc;x1(ro2)]; yc=[yc;y1(ro2)]; zc=[zc;z1(ro2)]; 177 197 178 198 %next edge: … … 184 204 x1(ro2)=[]; x2(ro2)=[]; 185 205 y1(ro2)=[]; y2(ro2)=[]; 206 z1(ro2)=[]; z2(ro2)=[]; 186 207 187 208 %next connection … … 192 213 contours(end+1).x=xc; 193 214 contours(end).y=yc; 215 contours(end).z=zc; 194 216 contours(end).name=''; 195 217 contours(end).nods=length(xc);
Note:
See TracChangeset
for help on using the changeset viewer.