Changeset 25836 for issm/trunk/src/m/plot/processmesh.m
- Timestamp:
- 12/08/20 08:45:53 (4 years ago)
- Location:
- issm/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk
- Property svn:mergeinfo changed
-
issm/trunk/src
- Property svn:mergeinfo changed
-
issm/trunk/src/m/plot/processmesh.m
r22758 r25836 15 15 end 16 16 17 %special case for mes g2dvertical17 %special case for mesh 2dvertical 18 18 if strcmp(domaintype(md.mesh),'2Dvertical'), 19 19 [x y z elements is2d isplanet] = processmesh(md.mesh,options); … … 24 24 if strcmp(domaintype(md.mesh),'3Dsurface'), 25 25 [x y z elements is2d isplanet] = processmesh(md.mesh,options); 26 if strcmpi(getfieldvalue(options,'coord','xy'),'latlon') | strcmpi(getfieldvalue(options,'coord','xy'),'latlong'), 27 x0=md.mesh.long; 28 y0=md.mesh.lat; 29 %add row at lat=90 and lat=-90 30 add=[(-180:.1:-1e-5)';(1e-5:.1:180)']; 31 nadd=length(add); 32 xextra=[add;add]; 33 yextra=[90*ones(nadd,1); -90*ones(nadd,1)]; 34 x=[x0;xextra]; 35 y=[y0;yextra]; 36 37 if strcmpi(getfieldvalue(options,'coordcent','atlantic'),'pacific'), 38 pos=find(x>0); x(pos)=-360+x(pos); 39 end 40 elements=delaunay(x,y); 41 z=x; z(:)=0; 42 end 26 43 return; 27 44 end … … 36 53 else 37 54 elements=md.mesh.elements; 38 if ~strcmpi(getfieldvalue(options,'coord','xy'),'latlon') ,55 if ~strcmpi(getfieldvalue(options,'coord','xy'),'latlon') & ~strcmpi(getfieldvalue(options,'coord','xy'),'latlong') , 39 56 x=md.mesh.x; 40 57 if isprop(md.mesh,'x2d'), x2d=md.mesh.x2d; end … … 44 61 x=md.mesh.long; 45 62 y=md.mesh.lat; 63 if strcmpi(getfieldvalue(options,'coordcent','atlantic'),'pacific'), 64 pos=find(x>0); x(pos)-360+x(pos); 65 end 46 66 end 47 67 end … … 58 78 59 79 %is it a 2d plot? 60 if md.mesh.dimension()==2 ,80 if md.mesh.dimension()==2 || getfieldvalue(options,'layer',0)>=1 || getfieldvalue(options,'depthaverage',0) 61 81 is2d=1; 62 82 else 63 if getfieldvalue(options,'layer',0)>=1, 64 is2d=1; 65 else 66 is2d=0; 67 end 83 is2d=0; 68 84 end 69 85 70 86 %layer projection? 71 if getfieldvalue(options,'layer',0)>=1 ,87 if getfieldvalue(options,'layer',0)>=1 || getfieldvalue(options,'depthaverage',0) 72 88 if strcmpi(getfieldvalue(options,'coord','xy'),'latlon'), 73 89 error('processmesh error message: cannot work with 3D meshes for now'); 74 90 end 75 %we modify the mesh temporarily to a 2d mesh from which the 3d mesh was extruded .91 %we modify the mesh temporarily to a 2d mesh from which the 3d mesh was extruded 76 92 x=x2d; 77 93 y=y2d;
Note:
See TracChangeset
for help on using the changeset viewer.