source:
issm/oecreview/Archive/16133-16554/ISSM-16487-16488.diff
Last change on this file was 16556, checked in by , 11 years ago | |
---|---|
File size: 2.5 KB |
-
../trunk-jpl/src/m/plot/processmesh.m
20 20 return; 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 31 else 32 x=md.mesh.long; 33 y=md.mesh.lat; 34 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 35 42 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; 43 end 43 if isprop(md.mesh,'elements2d'), elements2d=md.mesh.elements2d; end 44 elements=md.mesh.elements; 44 45 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);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, 50 51 is2d=1; 51 elseif (md.mesh.dimension==3),52 if getfieldvalue(options,'layer',0)>=1,53 is2d=1;54 else55 is2d=0;56 end57 52 else 58 error(['dim = ' num2str(md.mesh.dimension) ' not supported yet']);53 is2d=0; 59 54 end 55 else 56 error(['dim = ' num2str(md.mesh.dimension) ' not supported yet']); 57 end 60 58 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; 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'); 71 63 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 74 71 %units
Note:
See TracBrowser
for help on using the repository browser.