Changeset 1740
- Timestamp:
- 08/18/09 07:55:50 (16 years ago)
- Location:
- issm/trunk/src/m/classes/public/plot
- Files:
-
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/m/classes/public/plot/plot_basaldrag.m
r27 r1740 39 39 %process data and model 40 40 [x y z elements is2d]=processmesh(md,options_structure); 41 [basal_drag isongrid ]=processdata(md,drag,options_structure);41 [basal_drag isongrid isquiver]=processdata(md,drag,options_structure); 42 42 43 43 %plot basaldrag 44 44 subplot(width,width,i); 45 plot_unit(x,y,z,elements,basal_drag,isongrid,is2d, options_structure);45 plot_unit(x,y,z,elements,basal_drag,isongrid,is2d,isquiver,options_structure); 46 46 47 47 %apply options -
issm/trunk/src/m/classes/public/plot/plot_contour.m
r844 r1740 9 9 %process data and model 10 10 [x y z index is2d]=processmesh(md,options_structure); 11 [data isongrid ]=processdata(md,data,options_structure);11 [data isongrid isquiver]=processdata(md,data,options_structure); 12 12 13 13 %check is2d -
issm/trunk/src/m/classes/public/plot/plot_drivingstress.m
r338 r1740 12 12 %process data and model 13 13 [x y z elements is2d]=processmesh(md,options_structure); 14 [dstress isongrid ]=processdata(md,s,options_structure);14 [dstress isongrid isquiver]=processdata(md,s,options_structure); 15 15 dstress=dstress/1000; 16 16 17 17 %plot mesh quivervel 18 18 subplot(width,width,i); 19 plot_unit(x,y,z,elements,dstress,isongrid,is2d, options_structure)19 plot_unit(x,y,z,elements,dstress,isongrid,is2d,isquiver,options_structure) 20 20 21 21 %apply options -
issm/trunk/src/m/classes/public/plot/plot_elementstype.m
r1651 r1740 9 9 %process data and model 10 10 [x y z elements is2d]=processmesh(md,options_structure); 11 [data1 isongrid ]=processdata(md,md.elements_type(:,1),options_structure);12 [data2 isongrid ]=processdata(md,md.elements_type(:,2),options_structure);11 [data1 isongrid isquiver]=processdata(md,md.elements_type(:,1),options_structure); 12 [data2 isongrid isquiver]=processdata(md,md.elements_type(:,2),options_structure); 13 13 data=[data1 data2]; 14 14 -
issm/trunk/src/m/classes/public/plot/plot_gridnumbering.m
r1 r1740 9 9 %process data and model 10 10 [x y z elements is2d]=processmesh(md,options_structure); 11 [gridnumbers isongrid ]=processdata(md,[1:md.numberofgrids]',options_structure);11 [gridnumbers isongrid isquiver]=processdata(md,[1:md.numberofgrids]',options_structure); 12 12 13 13 %plot -
issm/trunk/src/m/classes/public/plot/plot_highlightgrids.m
r1 r1740 9 9 %process data and model 10 10 [x y z elements is2d]=processmesh(md,options_structure); 11 [gridnumbers isongrid ]=processdata(md,[1:md.numberofgrids]',options_structure);11 [gridnumbers isongrid isquiver]=processdata(md,[1:md.numberofgrids]',options_structure); 12 12 13 13 %plot -
issm/trunk/src/m/classes/public/plot/plot_manager.m
r1110 r1740 126 126 %process data and model 127 127 [x y z elements is2d]=processmesh(md,options_structure); 128 [data isongrid ]=processdata(md,data,options_structure);128 [data isongrid isquiver]=processdata(md,data,options_structure); 129 129 130 130 %standard plot: 131 131 subplot(width,width,i); 132 plot_unit(x,y,z,elements,data,isongrid,is2d, options_structure);132 plot_unit(x,y,z,elements,data,isongrid,is2d,isquiver,options_structure); 133 133 134 134 %apply all options -
issm/trunk/src/m/classes/public/plot/plot_overlay.m
r1295 r1740 21 21 %process mesh and data 22 22 [x y z elements is2d]=processmesh(md,options_structure); 23 [data isongrid ]=processdata(md,data,options_structure);23 [data isongrid isquiver]=processdata(md,data,options_structure); 24 24 25 25 %apply caxis if required … … 72 72 %process mesh and data 73 73 [x y z elements is2d]=processmesh(md,options_structure); 74 [data isongrid ]=processdata(md,data,options_structure);74 [data isongrid isquiver]=processdata(md,data,options_structure); 75 75 76 76 %get previous result -
issm/trunk/src/m/classes/public/plot/plot_quiver.m
r27 r1740 9 9 %process data and model 10 10 [x y z elements is2d]=processmesh(md,options_structure); 11 [vx isongrid ]=processdata(md,md.vx,options_structure);12 [vy isongrid ]=processdata(md,md.vy,options_structure);11 [vx isongrid isquiver]=processdata(md,md.vx,options_structure); 12 [vy isongrid isquiver]=processdata(md,md.vy,options_structure); 13 13 14 14 %plot mesh quivervel -
issm/trunk/src/m/classes/public/plot/plot_quiver3.m
r27 r1740 9 9 %process data and model 10 10 [x y z elements is2d]=processmesh(md,options_structure); 11 [vx isongrid ]=processdata(md,md.vx,options_structure);12 [vy isongrid ]=processdata(md,md.vy,options_structure);13 [vz isongrid ]=processdata(md,md.vz,options_structure);11 [vx isongrid isquiver]=processdata(md,md.vx,options_structure); 12 [vy isongrid isquiver]=processdata(md,md.vy,options_structure); 13 [vz isongrid isquiver]=processdata(md,md.vz,options_structure); 14 14 15 15 %plot mesh quivervel3 -
issm/trunk/src/m/classes/public/plot/plot_quivervel.m
r338 r1740 9 9 %process data and model 10 10 [x y z elements is2d]=processmesh(md,options_structure); 11 [vx isongrid ]=processdata(md,md.vx,options_structure);12 [vy isongrid ]=processdata(md,md.vy,options_structure);11 [vx isongrid isquiver]=processdata(md,md.vx,options_structure); 12 [vy isongrid isquiver]=processdata(md,md.vy,options_structure); 13 13 if ~isnan(md.vz) 14 [vz isongrid ]=processdata(md,md.vz,options_structure);14 [vz isongrid isquiver]=processdata(md,md.vz,options_structure); 15 15 end 16 16 … … 28 28 subplot(width,width,i); 29 29 colormap('default') 30 plot_unit(x,y,z,elements,sqrt(vx.^2+vy.^2),isongrid,is2d, options_structure)30 plot_unit(x,y,z,elements,sqrt(vx.^2+vy.^2),isongrid,is2d,isquiver,options_structure) 31 31 32 32 if is2d -
issm/trunk/src/m/classes/public/plot/plot_section.m
r1171 r1740 22 22 %process data and model 23 23 [x_m y_m z_m elements_m is2d]=processmesh(md,options_structure); 24 [data isongrid ]=processdata(md,data,options_structure);24 [data isongrid isquiver]=processdata(md,data,options_structure); 25 25 26 26 %replug x and y onto model so that SectionValue treats the problem correctly … … 62 62 %plot section only with labels 63 63 subplot(width,width,index2) 64 plot_unit(x_m,y_m,z_m,elements_m,data,isongrid,is2d, options_structure)64 plot_unit(x_m,y_m,z_m,elements_m,data,isongrid,is2d,isquiver,options_structure) 65 65 hold on 66 66 text(x(1),y(1),'1','backgroundcolor',[0.8 0.9 0.8]) … … 98 98 %plot section only with labels 99 99 subplot(width,width,index2) 100 plot_unit(x_m,y_m,z_m,elements_m,data,isongrid,is2d, options_structure)100 plot_unit(x_m,y_m,z_m,elements_m,data,isongrid,is2d,isquiver,options_structure) 101 101 hold on 102 102 text(x(1),y(1),'1','backgroundcolor',[0.8 0.9 0.8]) … … 132 132 %plot section only with labels 133 133 subplot(width,width,index2) 134 plot_unit(x_m,y_m,z_m,elements_m,data,isongrid,is2d, options_structure)134 plot_unit(x_m,y_m,z_m,elements_m,data,isongrid,is2d,isquiver,options_structure) 135 135 hold on 136 136 text(x(1),y(1),'1','backgroundcolor',[0.8 0.9 0.8]) -
issm/trunk/src/m/classes/public/plot/plot_streamlines.m
r27 r1740 11 11 %process data and model 12 12 [x y z index is2d]=processmesh(md,options_structure); 13 [u isongrid ]=processdata(md,md.vx,options_structure);14 [v isongrid ]=processdata(md,md.vy,options_structure);13 [u isongrid isquiver]=processdata(md,md.vx,options_structure); 14 [v isongrid isquiver]=processdata(md,md.vy,options_structure); 15 15 16 16 %some checks -
issm/trunk/src/m/classes/public/plot/plot_tensor_components.m
r338 r1740 25 25 %process data and model 26 26 [x y z elements is2d]=processmesh(md,options_structure); 27 [tensor.xx isongrid ]=processdata(md,tensor.xx,options_structure);28 [tensor.yy isongrid ]=processdata(md,tensor.yy,options_structure);29 [tensor.xy isongrid ]=processdata(md,tensor.xy,options_structure);27 [tensor.xx isongrid isquiver]=processdata(md,tensor.xx,options_structure); 28 [tensor.yy isongrid isquiver]=processdata(md,tensor.yy,options_structure); 29 [tensor.xy isongrid isquiver]=processdata(md,tensor.xy,options_structure); 30 30 if strcmpi(md.type,'3d') 31 [tensor.xz isongrid ]=processdata(md,tensor.xz,options_structure);32 [tensor.yz isongrid ]=processdata(md,tensor.yz,options_structure);33 [tensor.zz isongrid ]=processdata(md,tensor.zz,options_structure);31 [tensor.xz isongrid isquiver]=processdata(md,tensor.xz,options_structure); 32 [tensor.yz isongrid isquiver]=processdata(md,tensor.yz,options_structure); 33 [tensor.zz isongrid isquiver]=processdata(md,tensor.zz,options_structure); 34 34 end 35 35 36 36 if (strcmpi(md.type,'2d')), 37 37 subplot(2*width,2*width,index1), 38 plot_unit(x,y,z,elements,tensor.xx,isongrid,is2d, options_structure)38 plot_unit(x,y,z,elements,tensor.xx,isongrid,is2d,isquiver,options_structure) 39 39 Apply_options_tensor(md,options_structure,type,'xx') 40 40 subplot(2*width,2*width,index2), 41 plot_unit(x,y,z,elements,tensor.yy,isongrid,is2d, options_structure)41 plot_unit(x,y,z,elements,tensor.yy,isongrid,is2d,isquiver,options_structure) 42 42 Apply_options_tensor(md,options_structure,type,'yy') 43 43 subplot(2*width,2*width,index3), 44 plot_unit(x,y,z,elements,tensor.xy,isongrid,is2d, options_structure)44 plot_unit(x,y,z,elements,tensor.xy,isongrid,is2d,isquiver,options_structure) 45 45 Apply_options_tensor(md,options_structure,type,'xy') 46 46 else 47 47 subplot(3*width,3*width,index1), 48 plot_unit(x,y,z,elements,tensor.xx,isongrid,is2d, options_structure)48 plot_unit(x,y,z,elements,tensor.xx,isongrid,is2d,isquiver,options_structure) 49 49 Apply_options_tensor(md,options_structure,type,'xx') 50 50 subplot(3*width,3*width,index2), 51 plot_unit(x,y,z,elements,tensor.yy,isongrid,is2d, options_structure)51 plot_unit(x,y,z,elements,tensor.yy,isongrid,is2d,isquiver,options_structure) 52 52 Apply_options_tensor(md,options_structure,type,'yy') 53 53 subplot(3*width,3*width,index3), 54 plot_unit(x,y,z,elements,tensor.zz,isongrid,is2d, options_structure)54 plot_unit(x,y,z,elements,tensor.zz,isongrid,is2d,isquiver,options_structure) 55 55 Apply_options_tensor(md,options_structure,type,'zz') 56 56 subplot(3*width,3*width,index4), 57 plot_unit(x,y,z,elements,tensor.xy,isongrid,is2d, options_structure)57 plot_unit(x,y,z,elements,tensor.xy,isongrid,is2d,isquiver,options_structure) 58 58 Apply_options_tensor(md,options_structure,type,'xy') 59 59 subplot(3*width,3*width,index5), 60 plot_unit(x,y,z,elements,tensor.xz,isongrid,is2d, options_structure)60 plot_unit(x,y,z,elements,tensor.xz,isongrid,is2d,isquiver,options_structure) 61 61 Apply_options_tensor(md,options_structure,type,'xz') 62 62 subplot(3*width,3*width,index6), 63 plot_unit(x,y,z,elements,tensor.yz,isongrid,is2d, options_structure)63 plot_unit(x,y,z,elements,tensor.yz,isongrid,is2d,isquiver,options_structure) 64 64 Apply_options_tensor(md,options_structure,type,'yz') 65 65 end -
issm/trunk/src/m/classes/public/plot/plot_tensor_principal.m
r338 r1740 38 38 %now plot principal values 39 39 [x y z elements is2d]=processmesh(md,options_structure); 40 [tensor.principalvalue1 isongrid ]=processdata(md,tensor.principalvalue1,options_structure);41 [tensor.principalvalue2 isongrid ]=processdata(md,tensor.principalvalue2,options_structure);40 [tensor.principalvalue1 isongrid isquiver]=processdata(md,tensor.principalvalue1,options_structure); 41 [tensor.principalvalue2 isongrid isquiver]=processdata(md,tensor.principalvalue2,options_structure); 42 42 if strcmpi(md.type,'3d') 43 [tensor.principalvalue3 isongrid ]=processdata(md,tensor.principalvalue3,options_structure);43 [tensor.principalvalue3 isongrid isquiver]=processdata(md,tensor.principalvalue3,options_structure); 44 44 end 45 45 46 46 if (strcmpi(md.type,'2d')), 47 47 subplot(2*width,2*width,index3) 48 plot_unit(x,y,z,elements,tensor.principalvalue1,isongrid,is2d, options_structure)48 plot_unit(x,y,z,elements,tensor.principalvalue1,isongrid,is2d,isquiver,options_structure) 49 49 Apply_options_tensor(md,options_structure,type,'principal value 1') 50 50 subplot(2*width,2*width,index4) 51 plot_unit(x,y,z,elements,tensor.principalvalue2,isongrid,is2d, options_structure)51 plot_unit(x,y,z,elements,tensor.principalvalue2,isongrid,is2d,isquiver,options_structure) 52 52 Apply_options_tensor(md,options_structure,type,'principal value 2') 53 53 else 54 54 subplot(3*width,3*width,index4) 55 plot_unit(x,y,z,elements,tensor.principalvalue1,isongrid,is2d, options_structure)55 plot_unit(x,y,z,elements,tensor.principalvalue1,isongrid,is2d,isquiver,options_structure) 56 56 Apply_options_tensor(md,options_structure,type,'principal value 1') 57 57 subplot(3*width,3*width,index5) 58 plot_unit(x,y,z,elements,tensor.principalvalue2,isongrid,is2d, options_structure)58 plot_unit(x,y,z,elements,tensor.principalvalue2,isongrid,is2d,isquiver,options_structure) 59 59 Apply_options_tensor(md,options_structure,type,'principal value 2') 60 60 subplot(3*width,3*width,index6) 61 plot_unit(x,y,z,elements,tensor.principalvalue3,isongrid,is2d, options_structure)61 plot_unit(x,y,z,elements,tensor.principalvalue3,isongrid,is2d,isquiver,options_structure) 62 62 Apply_options_tensor(md,options_structure,type,'principal value 3') 63 63 end -
issm/trunk/src/m/classes/public/plot/plot_tensor_principalaxis.m
r27 r1740 16 16 eval(['Vx=tensor.principalaxis' type(end) '(:,1); Vy=tensor.principalaxis' type(end) '(:,2);']) 17 17 eval(['value=tensor.principalvalue' type(end) ';']); 18 [Vx isongrid ]=processdata(md,Vx,options_structure);19 [Vy isongrid ]=processdata(md,Vy,options_structure);20 [value isongrid ]=processdata(md,value,options_structure);18 [Vx isongrid isquiver]=processdata(md,Vx,options_structure); 19 [Vy isongrid isquiver]=processdata(md,Vy,options_structure); 20 [value isongrid isquiver]=processdata(md,value,options_structure); 21 21 else 22 22 eval(['Vx=tensor.principalaxis' type(end) '(:,1); Vy=tensor.principalaxis' type(end) '(:,2); Vz=tensor.principalaxis' type(end) '(:,3);']) 23 [Vx isongrid ]=processdata(md,Vx,options_structure);24 [Vy isongrid ]=processdata(md,Vy,options_structure);25 [Vz isongrid ]=processdata(md,Vz,options_structure);26 [value isongrid ]=processdata(md,value,options_structure);23 [Vx isongrid isquiver]=processdata(md,Vx,options_structure); 24 [Vy isongrid isquiver]=processdata(md,Vy,options_structure); 25 [Vz isongrid isquiver]=processdata(md,Vz,options_structure); 26 [value isongrid isquiver]=processdata(md,value,options_structure); 27 27 end 28 28 -
issm/trunk/src/m/classes/public/plot/plot_transient_movie.m
r1606 r1740 24 24 25 25 %process data 26 [data isongrid ]=processdata(md,data,options_structure);26 [data isongrid isquiver]=processdata(md,data,options_structure); 27 27 titlestring=[field ' at time ' num2str(md.results.transient(i).time/md.yts) ' year']; 28 plot_unit(x,y,z,elements,data,isongrid,is2d, options_structure)28 plot_unit(x,y,z,elements,data,isongrid,is2d,isquiver,options_structure) 29 29 apply_options_movie(md,options_structure,titlestring); 30 30 -
issm/trunk/src/m/classes/public/plot/plot_unit.m
r1261 r1740 1 function plot_unit(x,y,z,elements,data,isongrid,is2d, options_structure)1 function plot_unit(x,y,z,elements,data,isongrid,is2d,isquiver,options_structure) 2 2 %PLOT_UNIT - unit plot, display data 3 3 % 4 4 % Usage: 5 % plot_unit(x,y,z,elements,data,isongrid,is2d, options_structure);5 % plot_unit(x,y,z,elements,data,isongrid,is2d,isquiver,options_structure); 6 6 % 7 7 % See also: PLOTMODEL, PLOT_MANAGER … … 14 14 end 15 15 16 % element data17 if ~is ongrid18 pos=find(~isnan(data)); %needed fpr element on water 19 if is2d20 A=elements(pos,1); B=elements(pos,2); C=elements(pos,3);21 p atch( 'Faces', [A B C], 'Vertices', [x y z],'CData', data(pos),'FaceColor','flat','EdgeColor',edgecolor);22 else23 A=elements(pos,1); B=elements(pos,2); C=elements(pos,3); D=elements(pos,4); E=elements(pos,5); F=elements(pos,6);24 patch( 'Faces', [A B C], 'Vertices', [x y z],'CData', data(pos),'FaceColor','flat','EdgeColor',edgecolor);25 patch( 'Faces', [D E F], 'Vertices', [x y z],'CData', data(pos),'FaceColor','flat','EdgeColor',edgecolor);26 patch( 'Faces', [A B E D], 'Vertices', [x y z],'CData', data(pos),'FaceColor','flat','EdgeColor',edgecolor);27 patch( 'Faces', [B E F C], 'Vertices', [x y z],'CData', data(pos),'FaceColor','flat','EdgeColor',edgecolor);28 patch( 'Faces', [C A D F], 'Vertices', [x y z],'CData', data(pos),'FaceColor','flat','EdgeColor',edgecolor);29 end30 %grid data 31 elseif isongrid 32 if is2d33 A=elements(:,1); B=elements(:,2); C=elements(:,3); 34 patch( 'Faces', [A B C], 'Vertices', [x y z],'FaceVertexCData', data(:),'FaceColor','interp','EdgeColor',edgecolor);35 else 36 if options_structure.layer>=1,16 %regular plot 17 if ~isquiver, 18 19 %element data 20 if ~isongrid 21 pos=find(~isnan(data)); %needed fpr element on water 22 if is2d, 23 A=elements(pos,1); B=elements(pos,2); C=elements(pos,3); 24 patch( 'Faces', [A B C], 'Vertices', [x y z],'CData', data(pos),'FaceColor','flat','EdgeColor',edgecolor); 25 else 26 A=elements(pos,1); B=elements(pos,2); C=elements(pos,3); D=elements(pos,4); E=elements(pos,5); F=elements(pos,6); 27 patch( 'Faces', [A B C], 'Vertices', [x y z],'CData', data(pos),'FaceColor','flat','EdgeColor',edgecolor); 28 patch( 'Faces', [D E F], 'Vertices', [x y z],'CData', data(pos),'FaceColor','flat','EdgeColor',edgecolor); 29 patch( 'Faces', [A B E D], 'Vertices', [x y z],'CData', data(pos),'FaceColor','flat','EdgeColor',edgecolor); 30 patch( 'Faces', [B E F C ], 'Vertices', [x y z],'CData', data(pos),'FaceColor','flat','EdgeColor',edgecolor); 31 patch( 'Faces', [C A D F ], 'Vertices', [x y z],'CData', data(pos),'FaceColor','flat','EdgeColor',edgecolor); 32 end 33 34 %grid data 35 elseif isongrid 36 if is2d, 37 37 A=elements(:,1); B=elements(:,2); C=elements(:,3); 38 38 patch( 'Faces', [A B C], 'Vertices', [x y z],'FaceVertexCData', data(:),'FaceColor','interp','EdgeColor',edgecolor); … … 46 46 end 47 47 end 48 49 %quiver 50 elseif isquiver, 51 52 %grid data 53 if isongrid, 54 if is2d, 55 quivercolor(x,y,data(:,1),data(:,2)); 56 else 57 quivercolor3(x,y,z,data(:,1),data(:,2),data(:,3)); 58 end 59 else 60 error('plot_unit error message: element quiver not implemented yet') 61 end 48 62 end -
issm/trunk/src/m/classes/public/plot/processdata.m
r1218 r1740 1 function [data isongrid ]=processdata(md,data,options_structure);1 function [data isongrid isquiver]=processdata(md,data,options_structure); 2 2 %PROCESSDATA - process data to be plotted 3 3 % 4 4 % Usage: 5 % [data isongrid ]=processdata(md,data,options_structure);5 % [data isongrid isquiver]=processdata(md,data,options_structure); 6 6 % 7 7 % See also: PLOTMODEL, PROCESSMESH 8 8 9 9 %check format 10 if (iscell(data) | isempty(data) ),10 if (iscell(data) | isempty(data) | isnan(data)), 11 11 error('plotmodel error message: data provided is empty'); 12 12 end 13 13 14 %make a column out of data 15 data=data(:); 14 %transpose data if necessary 15 if (size(data,2) > size(data,1)), 16 data=data'; 17 end 18 datasize=size(data); 16 19 17 20 %check length 18 if length(data)~=md.numberofgrids & length(data)~=md.numberofelements & length(data)~=md.numberofgrids*6 & (strcmpi(md.type,'2d') | length(data)~=md.numberofgrids2d)21 if datasize(1)~=md.numberofgrids & datasize(1)~=md.numberofelements & datasize(1)~=md.numberofgrids*6 & (strcmpi(md.type,'2d') | datasize(1)~=md.numberofgrids2d) 19 22 error('plotmodel error message: data not supproted yet') 20 23 end 21 24 22 %treat the case length(data)=6*grids 23 if length(data)==6*md.numberofgrids 25 %isquiver? 26 if datasize(2)>1, 27 isquiver=1; 28 29 %check number of columns, add zeros if necessary, 30 if (strcmpi(md.type,'3d')) 31 if datasize(2)==2, 32 data=[data, zeros(datasize(1),1)]; 33 elseif datasize(2)~=3, 34 error('plotmodel error message: data provided should have 2 or 3 columns for quiver plot, and 1 for regular plot'); 35 end 36 elseif (strcmpi(md.type,'2d') & datasize(2)~=2), 37 error('plotmodel error message: data provided should have 2 columns for quiver plot, and 1 for regular plot'); 38 end 39 40 else 41 isquiver=0; 42 end 43 44 %treat the case datasize(1)=6*grids 45 if datasize(1)==6*md.numberofgrids 24 46 %keep the only norm of data 25 data1=data(1:6:md.numberofgrids*6 );26 data2=data(2:6:md.numberofgrids*6 );47 data1=data(1:6:md.numberofgrids*6,:); 48 data2=data(2:6:md.numberofgrids*6,:); 27 49 data=sqrt(data1.^2+data2.^2); 28 50 %---> go to grid data 29 51 end 30 52 31 %treat the case length(data)=grids2d32 if (strcmpi(md.type,'3d') & length(data)==md.numberofgrids2d),53 %treat the case datasize(1)=grids2d 54 if (strcmpi(md.type,'3d') & datasize(1)==md.numberofgrids2d), 33 55 data=project3d(md,data,'node'); 34 56 %---> go to grid data … … 42 64 43 65 %element data 44 if length(data)==md.numberofelements;66 if datasize(1)==md.numberofelements; 45 67 isongrid=0; 46 68 47 69 %ice sheet only? 48 70 if ~isnan(options_structure.noiceshelf) & options_structure.noiceshelf, 49 data(find(md.elementoniceshelf) )=NaN;71 data(find(md.elementoniceshelf),:)=NaN; 50 72 end 51 73 %ice shelf only? 52 74 if ~isnan(options_structure.noicesheet) & options_structure.noicesheet, 53 data(find(~md.elementoniceshelf) )=NaN;75 data(find(~md.elementoniceshelf),:)=NaN; 54 76 end 55 77 %no water? 56 78 if ~isnan(options_structure.nowater) & options_structure.nowater, 57 data(find(md.elementonwater) )=NaN;79 data(find(md.elementonwater),:)=NaN; 58 80 end 59 81 %log? … … 65 87 66 88 %grid data 67 if length(data)==md.numberofgrids89 if datasize(1)==md.numberofgrids 68 90 isongrid=1; 69 91 %ice sheet only? 70 92 if ~isnan(options_structure.noiceshelf) & options_structure.noiceshelf, 71 93 pos=find(md.gridoniceshelf); 72 data(pos )=NaN;94 data(pos,:)=NaN; 73 95 end 74 96 %ice shelf only? 75 97 if ~isnan(options_structure.noiceshelf) & options_structure.noicesheet, 76 98 pos=find(md.gridonicesheet); 77 data(pos )=NaN;99 data(pos,:)=NaN; 78 100 end 79 101 %no water? 80 102 if ~isnan(options_structure.nowater) & options_structure.nowater, 81 103 pos=find(md.gridonwater); 82 data(pos )=NaN;104 data(pos,:)=NaN; 83 105 end 84 106 %log?
Note:
See TracChangeset
for help on using the changeset viewer.