[16556] | 1 | Index: ../trunk-jpl/src/m/plot/processmesh.m
|
---|
| 2 | ===================================================================
|
---|
| 3 | --- ../trunk-jpl/src/m/plot/processmesh.m (revision 16487)
|
---|
| 4 | +++ ../trunk-jpl/src/m/plot/processmesh.m (revision 16488)
|
---|
| 5 | @@ -20,55 +20,52 @@
|
---|
| 6 | return;
|
---|
| 7 | end
|
---|
| 8 |
|
---|
| 9 | -if ~isempty(data)
|
---|
| 10 | - %first load x,y, etc ... to speed up plot
|
---|
| 11 | +%first load x,y, etc ... to speed up plot
|
---|
| 12 | +if ~strcmpi(getfieldvalue(options,'coord','xy'),'latlon'),
|
---|
| 13 | + x=md.mesh.x;
|
---|
| 14 | + if isprop(md.mesh,'x2d'), x2d=md.mesh.x2d; end
|
---|
| 15 | + y=md.mesh.y;
|
---|
| 16 | + if isprop(md.mesh,'y2d'), y2d=md.mesh.y2d; end
|
---|
| 17 | +else
|
---|
| 18 | + x=md.mesh.long;
|
---|
| 19 | + y=md.mesh.lat;
|
---|
| 20 | +end
|
---|
| 21 |
|
---|
| 22 | - if ~strcmpi(getfieldvalue(options,'coord','xy'),'latlon'),
|
---|
| 23 | - x=md.mesh.x;
|
---|
| 24 | - if isprop(md.mesh,'x2d'), x2d=md.mesh.x2d; end
|
---|
| 25 | - y=md.mesh.y;
|
---|
| 26 | - if isprop(md.mesh,'y2d'), y2d=md.mesh.y2d; end
|
---|
| 27 | - else
|
---|
| 28 | - x=md.mesh.long;
|
---|
| 29 | - y=md.mesh.lat;
|
---|
| 30 | - end
|
---|
| 31 | +z_field=getfieldvalue(options,'z',md.mesh.z);
|
---|
| 32 | +if ischar(z_field),
|
---|
| 33 | + z=md.(z_field);
|
---|
| 34 | +elseif isnumeric(z_field),
|
---|
| 35 | + z=z_field;
|
---|
| 36 | +else
|
---|
| 37 | + z=md.mesh.z;
|
---|
| 38 | +end
|
---|
| 39 |
|
---|
| 40 | - z_field=getfieldvalue(options,'z',md.mesh.z);
|
---|
| 41 | - if ischar(z_field),
|
---|
| 42 | - z=md.(z_field);
|
---|
| 43 | - elseif isnumeric(z_field),
|
---|
| 44 | - z=z_field;
|
---|
| 45 | - else
|
---|
| 46 | - z=md.mesh.z;
|
---|
| 47 | - end
|
---|
| 48 | +if isprop(md.mesh,'elements2d'), elements2d=md.mesh.elements2d; end
|
---|
| 49 | +elements=md.mesh.elements;
|
---|
| 50 |
|
---|
| 51 | - if isprop(md.mesh,'elements2d'), elements2d=md.mesh.elements2d; end
|
---|
| 52 | - elements=md.mesh.elements;
|
---|
| 53 | -
|
---|
| 54 | - %is it a 2d plot?
|
---|
| 55 | - if (md.mesh.dimension==2);
|
---|
| 56 | +%is it a 2d plot?
|
---|
| 57 | +if (md.mesh.dimension==2);
|
---|
| 58 | + is2d=1;
|
---|
| 59 | +elseif (md.mesh.dimension==3),
|
---|
| 60 | + if getfieldvalue(options,'layer',0)>=1,
|
---|
| 61 | is2d=1;
|
---|
| 62 | - elseif (md.mesh.dimension==3),
|
---|
| 63 | - if getfieldvalue(options,'layer',0)>=1,
|
---|
| 64 | - is2d=1;
|
---|
| 65 | - else
|
---|
| 66 | - is2d=0;
|
---|
| 67 | - end
|
---|
| 68 | else
|
---|
| 69 | - error(['dim = ' num2str(md.mesh.dimension) ' not supported yet']);
|
---|
| 70 | + is2d=0;
|
---|
| 71 | end
|
---|
| 72 | +else
|
---|
| 73 | + error(['dim = ' num2str(md.mesh.dimension) ' not supported yet']);
|
---|
| 74 | +end
|
---|
| 75 |
|
---|
| 76 | - %layer projection?
|
---|
| 77 | - if getfieldvalue(options,'layer',0)>=1,
|
---|
| 78 | - if strcmpi(getfieldvalue(options,'coord','xy'),'latlon'),
|
---|
| 79 | - error('processmesh error message: cannot work with 3D meshes for now');
|
---|
| 80 | - end
|
---|
| 81 | - %we modify the mesh temporarily to a 2d mesh from which the 3d mesh was extruded.
|
---|
| 82 | - x=x2d;
|
---|
| 83 | - y=y2d;
|
---|
| 84 | - z=zeros(size(x2d));
|
---|
| 85 | - elements=elements2d;
|
---|
| 86 | +%layer projection?
|
---|
| 87 | +if getfieldvalue(options,'layer',0)>=1,
|
---|
| 88 | + if strcmpi(getfieldvalue(options,'coord','xy'),'latlon'),
|
---|
| 89 | + error('processmesh error message: cannot work with 3D meshes for now');
|
---|
| 90 | end
|
---|
| 91 | + %we modify the mesh temporarily to a 2d mesh from which the 3d mesh was extruded.
|
---|
| 92 | + x=x2d;
|
---|
| 93 | + y=y2d;
|
---|
| 94 | + z=zeros(size(x2d));
|
---|
| 95 | + elements=elements2d;
|
---|
| 96 | end
|
---|
| 97 |
|
---|
| 98 | %units
|
---|