Changeset 16488 for issm/trunk-jpl/src/m/plot/processmesh.m
- Timestamp:
- 10/21/13 16:37:02 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/m/plot/processmesh.m
r16477 r16488 21 21 end 22 22 23 if ~isempty(data) 24 %first load x,y, etc ... to speed up plot 23 %first load x,y, etc ... to speed up plot 24 if ~strcmpi(getfieldvalue(options,'coord','xy'),'latlon'), 25 x=md.mesh.x; 26 if isprop(md.mesh,'x2d'), x2d=md.mesh.x2d; end 27 y=md.mesh.y; 28 if isprop(md.mesh,'y2d'), y2d=md.mesh.y2d; end 29 else 30 x=md.mesh.long; 31 y=md.mesh.lat; 32 end 25 33 26 if ~strcmpi(getfieldvalue(options,'coord','xy'),'latlon'), 27 x=md.mesh.x; 28 if isprop(md.mesh,'x2d'), x2d=md.mesh.x2d; end 29 y=md.mesh.y; 30 if isprop(md.mesh,'y2d'), y2d=md.mesh.y2d; end 34 z_field=getfieldvalue(options,'z',md.mesh.z); 35 if ischar(z_field), 36 z=md.(z_field); 37 elseif isnumeric(z_field), 38 z=z_field; 39 else 40 z=md.mesh.z; 41 end 42 43 if isprop(md.mesh,'elements2d'), elements2d=md.mesh.elements2d; end 44 elements=md.mesh.elements; 45 46 %is it a 2d plot? 47 if (md.mesh.dimension==2); 48 is2d=1; 49 elseif (md.mesh.dimension==3), 50 if getfieldvalue(options,'layer',0)>=1, 51 is2d=1; 31 52 else 32 x=md.mesh.long; 33 y=md.mesh.lat; 53 is2d=0; 34 54 end 55 else 56 error(['dim = ' num2str(md.mesh.dimension) ' not supported yet']); 57 end 35 58 36 z_field=getfieldvalue(options,'z',md.mesh.z); 37 if ischar(z_field), 38 z=md.(z_field); 39 elseif isnumeric(z_field), 40 z=z_field; 41 else 42 z=md.mesh.z; 59 %layer projection? 60 if getfieldvalue(options,'layer',0)>=1, 61 if strcmpi(getfieldvalue(options,'coord','xy'),'latlon'), 62 error('processmesh error message: cannot work with 3D meshes for now'); 43 63 end 44 45 if isprop(md.mesh,'elements2d'), elements2d=md.mesh.elements2d; end 46 elements=md.mesh.elements; 47 48 %is it a 2d plot? 49 if (md.mesh.dimension==2); 50 is2d=1; 51 elseif (md.mesh.dimension==3), 52 if getfieldvalue(options,'layer',0)>=1, 53 is2d=1; 54 else 55 is2d=0; 56 end 57 else 58 error(['dim = ' num2str(md.mesh.dimension) ' not supported yet']); 59 end 60 61 %layer projection? 62 if getfieldvalue(options,'layer',0)>=1, 63 if strcmpi(getfieldvalue(options,'coord','xy'),'latlon'), 64 error('processmesh error message: cannot work with 3D meshes for now'); 65 end 66 %we modify the mesh temporarily to a 2d mesh from which the 3d mesh was extruded. 67 x=x2d; 68 y=y2d; 69 z=zeros(size(x2d)); 70 elements=elements2d; 71 end 64 %we modify the mesh temporarily to a 2d mesh from which the 3d mesh was extruded. 65 x=x2d; 66 y=y2d; 67 z=zeros(size(x2d)); 68 elements=elements2d; 72 69 end 73 70
Note:
See TracChangeset
for help on using the changeset viewer.