Changeset 17674 for issm/trunk-jpl/src/m/plot
- Timestamp:
- 04/08/14 14:59:42 (11 years ago)
- Location:
- issm/trunk-jpl/src/m/plot
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/m/plot/applyoptions.m
r17568 r17674 49 49 50 50 %view 51 if strcmp(mesh type(md.mesh),'3D') & ~exist(options,'layer'),51 if strcmp(meshxdim(md.mesh),'3D') & ~exist(options,'layer'), 52 52 view(getfieldvalue(options,'view',3)); 53 53 else … … 60 60 eval(['axis ' getfieldvalue(options,'axis')]); 61 61 else 62 if strcmpi(mesh type(md.mesh),'2Dhorizontal') | exist(options,'layer'),62 if strcmpi(meshxdim(md.mesh),'2Dhorizontal') | exist(options,'layer'), 63 63 axis tight equal; 64 64 else -
issm/trunk-jpl/src/m/plot/plot_basaldrag.m
r17590 r17674 9 9 10 10 %check layer 11 if strcmp(meshtype(md.mesh),'3D'),11 if meshdim(md.mesh)==3, 12 12 if getfieldvalue(options,'layer',1)~=1; 13 13 disp('plot_basaldrag warning: basal drag is displayed in the lower layer') -
issm/trunk-jpl/src/m/plot/plot_edges.m
r17559 r17674 17 17 end 18 18 19 if (strcmp(mesh type(md.mesh),'2Dhorizontal')),19 if (strcmp(meshxdim(md.mesh),'2Dhorizontal')), 20 20 %plot mesh 21 21 A=elements(:,1); B=elements(:,2); C=elements(:,3); -
issm/trunk-jpl/src/m/plot/plot_icefront.m
r17559 r17674 19 19 elementzeroice=sum(zeroice(md.mesh.elements),2); 20 20 21 if (strcmp(mesh type(md.mesh),'2Dhorizontal')),21 if (strcmp(meshxdim(md.mesh),'2Dhorizontal')), 22 22 icefront=(elementice & elementnoice) & ~(elementice==2 & elementzeroice); 23 23 -
issm/trunk-jpl/src/m/plot/plot_penalties.m
r17559 r17674 21 21 end 22 22 23 if ~strcmp(mesh type(md.mesh),'3D'),23 if ~strcmp(meshxdim(md.mesh),'3D'), 24 24 error('no penalties to plot for ''2d'' model'); 25 25 elseif isempty(md.penalties), -
issm/trunk-jpl/src/m/plot/plot_qmu_mass_flux_segments.m
r17559 r17674 13 13 allsegments=md.qmu.mass_flux_segments; 14 14 15 if (strcmp(mesh type(md.mesh),'2Dhorizontal')),15 if (strcmp(meshxdim(md.mesh),'2Dhorizontal')), 16 16 17 17 %recover segments -
issm/trunk-jpl/src/m/plot/plot_referential.m
r17559 r17674 28 28 Yhat=cross(Zhat,Xhat); 29 29 30 if (strcmp(mesh type(md.mesh),'2Dhorizontal')),30 if (strcmp(meshxdim(md.mesh),'2Dhorizontal')), 31 31 32 32 %plot mesh -
issm/trunk-jpl/src/m/plot/plot_section.m
r17559 r17674 203 203 %apply options 204 204 options=addfielddefault(options,'title','Section value'); 205 if (strcmp(meshtype(md.mesh),'2Dhorizontal'))205 if meshdim(md.mesh)==2 206 206 options=addfielddefault(options,'colorbar',0); 207 207 end 208 if (( strcmp(meshtype(md.mesh),'2Dhorizontal')) | getfieldvalue(options,'view')==2 )208 if ((meshdim(md.mesh)==2) | getfieldvalue(options,'view')==2 ) 209 209 options=addfielddefault(options,'xlabel','Curvilinear coordinate'); 210 210 options=addfielddefault(options,'axis','auto'); 211 211 end 212 if ( strcmp(meshtype(md.mesh),'3D')& getfieldvalue(options,'view')==2 )212 if (meshdim(md.mesh)==3 & getfieldvalue(options,'view')==2 ) 213 213 options=addfielddefault(options,'ylabel','z'); 214 214 end -
issm/trunk-jpl/src/m/plot/plot_segments.m
r17559 r17674 14 14 segments=md.mesh.segments; 15 15 16 if (strcmp(mesh type(md.mesh),'2Dhorizontal')),16 if (strcmp(meshxdim(md.mesh),'2Dhorizontal')), 17 17 %plot mesh 18 18 A=elements(:,1); B=elements(:,2); C=elements(:,3); -
issm/trunk-jpl/src/m/plot/plot_tensor_components.m
r17559 r17674 10 10 upperplots=fix((i-1)/width); 11 11 if upperplots==0, leftplots=i-1; else leftplots=i-width*upperplots-1; end 12 if (strcmp(mesh type(md.mesh),'2Dhorizontal'))%3 components -> 3 indexes12 if (strcmp(meshxdim(md.mesh),'2Dhorizontal'))%3 components -> 3 indexes 13 13 index1=4*width*upperplots+2*leftplots+1; 14 14 index2=index1+1; 15 15 index3=index1+width*2; 16 elseif strcmp(meshtype(md.mesh),'3D')%6 components -> 6 indexes16 elseif meshdim(md.mesh)==3%6 components -> 6 indexes 17 17 index1=3*3*width*upperplots+3*leftplots+1; 18 18 index2=index1+1; … … 28 28 [tensor.yy datatype]=processdata(md,tensor.yy,options); 29 29 [tensor.xy datatype]=processdata(md,tensor.xy,options); 30 if strcmp(meshtype(md.mesh),'3D')30 if meshdim(md.mesh)==3 31 31 [tensor.xz datatype]=processdata(md,tensor.xz,options); 32 32 [tensor.yz datatype]=processdata(md,tensor.yz,options); … … 34 34 end 35 35 36 if ((strcmp(mesh type(md.mesh),'2Dhorizontal'))),36 if ((strcmp(meshxdim(md.mesh),'2Dhorizontal'))), 37 37 subplot(2*width,2*width,index1), 38 38 plot_unit(x,y,z,elements,tensor.xx,is2d,isplanet,datatype,options) -
issm/trunk-jpl/src/m/plot/plot_tensor_principal.m
r17559 r17674 10 10 upperplots=fix((i-1)/width); 11 11 if upperplots==0, leftplots=i-1; else leftplots=i-width*upperplots-1; end 12 if ( strcmp(meshtype(md.mesh),'2Dhorizontal'))%3 components -> 3 indexes12 if (meshdim(md.mesh)==2)%3 components -> 3 indexes 13 13 index1=4*width*upperplots+2*leftplots+1; 14 14 index2=index1+1; … … 16 16 index4=index3+1; 17 17 newwidth=2*width; 18 elseif strcmp(meshtype(md.mesh),'3D')%6 components -> 6 indexes18 elseif meshdim(md.mesh)==3%6 components -> 6 indexes 19 19 index1=3*3*width*upperplots+3*leftplots+1; 20 20 index2=index1+1; … … 31 31 type2=[type 'axis2']; 32 32 plot_tensor_principalaxis(md,options,newwidth,index2,tensor,type2,plot_options); 33 if strcmp(meshtype(md.mesh),'3D')33 if meshdim(md.mesh)==3 34 34 type3=[type 'axis3']; 35 35 plot_tensor_principalaxis(md,options,newwidth,index3,tensor,type3,plot_options); … … 40 40 [tensor.principalvalue1 datatype]=processdata(md,tensor.principalvalue1,options); 41 41 [tensor.principalvalue2 datatype]=processdata(md,tensor.principalvalue2,options); 42 if strcmp(meshtype(md.mesh),'3D')42 if meshdim(md.mesh)==3 43 43 [tensor.principalvalue3 datatype]=processdata(md,tensor.principalvalue3,options); 44 44 end 45 45 46 if ((strcmp(meshtype(md.mesh),'2Dhorizontal'))),46 if meshdim(md.mesh)==2, 47 47 subplot(2*width,2*width,index3) 48 48 plot_unit(x,y,z,elements,tensor.principalvalue1,is2d,isplanet,datatype,options) -
issm/trunk-jpl/src/m/plot/plot_tensor_principalaxis.m
r17559 r17674 13 13 [x y z elements is2d isplanet]=processmesh(md,[],options); 14 14 15 if ((strcmp(meshtype(md.mesh),'2Dhorizontal'))),15 if meshdim(md.mesh)==2, 16 16 eval(['Vx=tensor.principalaxis' type(end) '(:,1); Vy=tensor.principalaxis' type(end) '(:,2);']) 17 17 eval(['value=tensor.principalvalue' type(end) ';']); … … 33 33 34 34 %plot quivers 35 if (strcmp(meshtype(md.mesh),'2Dhorizontal')),35 if meshdim(md.mesh)==2, 36 36 37 37 %density -
issm/trunk-jpl/src/m/plot/plot_transient_results.m
r17559 r17674 41 41 clear string; 42 42 43 if strcmp(mesh type(md.mesh),'3D'),43 if strcmp(meshxdim(md.mesh),'3D'), 44 44 string='plotmodel(md'; 45 45 for i=1:length(md.results.transient), … … 67 67 clear string; 68 68 69 if strcmp(mesh type(md.mesh),'3D'),69 if strcmp(meshxdim(md.mesh),'3D'), 70 70 string='plotmodel(md'; 71 71 for i=2:length(md.results.transient), -
issm/trunk-jpl/src/m/plot/processdata.m
r17597 r17674 23 23 24 24 %special case for mesh 2dvertical 25 if strcmp(mesh type(md.mesh),'2Dvertical'),25 if strcmp(meshxdim(md.mesh),'2Dvertical'), 26 26 [data datatype] = processdata(md.mesh,md,data,options); 27 27 return; … … 56 56 57 57 %check length 58 if datasize(1)~=md.mesh.numberofvertices & datasize(1)~=md.mesh.numberofelements & datasize(1)~=md.mesh.numberofvertices*6 & (strcmp(md.mesh.mesh type(),'3D') & ~(datasize(1)==numberofelements2d | datasize(1)==numberofvertices2d))58 if datasize(1)~=md.mesh.numberofvertices & datasize(1)~=md.mesh.numberofelements & datasize(1)~=md.mesh.numberofvertices*6 & (strcmp(md.mesh.meshxdim(),'3D') & ~(datasize(1)==numberofelements2d | datasize(1)==numberofvertices2d)) 59 59 error('plotmodel error message: data not supported yet'); 60 60 end … … 65 65 66 66 %check number of columns, add zeros if necessary, 67 if (strcmp(md.mesh.mesh type(),'3D'))67 if (strcmp(md.mesh.meshxdim(),'3D')) 68 68 if datasize(2)==2, 69 69 data=[data, zeros(datasize(1),1)]; … … 85 85 86 86 %treat the case datasize(1)=nodes2d 87 if (strcmp(md.mesh.mesh type(),'3D') & datasize(1)==numberofvertices2d),87 if (strcmp(md.mesh.meshxdim(),'3D') & datasize(1)==numberofvertices2d), 88 88 data=project3d(md,'vector',data,'type','node'); 89 89 datasize(1)=md.mesh.numberofvertices; … … 92 92 93 93 %treat the case datasize(1)=nodes2d 94 if (strcmp(md.mesh.mesh type(),'3D') & datasize(1)==numberofelements2d),94 if (strcmp(md.mesh.meshxdim(),'3D') & datasize(1)==numberofelements2d), 95 95 data=project3d(md,'vector',data,'type','element'); 96 96 datasize(1)=md.mesh.numberofelements; -
issm/trunk-jpl/src/m/plot/processmesh.m
r17578 r17674 16 16 17 17 %special case for mesg 2dvertical 18 if strcmp(mesh type(md.mesh),'2Dvertical'),18 if strcmp(meshxdim(md.mesh),'2Dvertical'), 19 19 [x y z elements is2d isplanet] = processmesh(md.mesh,options); 20 20 return; … … 46 46 47 47 %is it a 2d plot? 48 if ~strcmp(md.mesh.meshtype(),'3D');48 if md.mesh.meshdim()==2, 49 49 is2d=1; 50 50 else -
issm/trunk-jpl/src/m/plot/processmesh.py
r17597 r17674 42 42 43 43 #is it a 2D plot? 44 if m.strcmp(md.mesh.mesh type(),'2Dhorizontal'):44 if m.strcmp(md.mesh.meshxdim(),'2Dhorizontal'): 45 45 is2d=1 46 elif m.strcmp(md.mesh.mesh type(),'3D'):46 elif m.strcmp(md.mesh.meshxdim(),'3D'): 47 47 if options.getfieldvalue('layer',0)>=1: 48 48 is2d=1 … … 64 64 else: 65 65 #Process mesh for plotting 66 if m.strcmp(md.mesh.mesh type(),'2Dhorizontal'):66 if m.strcmp(md.mesh.meshxdim(),'2Dhorizontal'): 67 67 is2d=1 68 68 else:
Note:
See TracChangeset
for help on using the changeset viewer.