source: issm/branches/trunk-jpl-damage/src/m/model/plot/plot_mesh.m@ 12194

Last change on this file since 12194 was 10947, checked in by Mathieu Morlighem, 13 years ago

Fixed plot mesh for export_fig and added queues in pfe

File size: 1.9 KB
Line 
1function plot_mesh(md,options,nlines,ncols,i);
2%PLOT_MESH - plot model mesh
3%
4% Usage:
5% plot_mesh(md,options,nlines,ncols,i);
6%
7% See also: PLOTMODEL
8
9%process data and model
10[x y z elements is2d isplanet]=processmesh(md,[],options);
11
12%plot mesh
13subplot(nlines,ncols,i);
14
15%retrieve some options
16linewidth=getfieldvalue(options,'linewidth',1);
17edgecolor=getfieldvalue(options,'edgecolor','black');
18
19%plot mesh
20if is2d
21 A=elements(:,1); B=elements(:,2); C=elements(:,3);
22 patch( 'Faces', [A B C], 'Vertices', [x y z],'FaceVertexCData',zeros(size(x)),'FaceColor','none','EdgeColor',edgecolor,'linewidth',linewidth);
23else
24 if ~isplanet,
25 A=elements(:,1); B=elements(:,2); C=elements(:,3); D=elements(:,4); E=elements(:,5); F=elements(:,6);
26 patch( 'Faces', [A B C], 'Vertices', [x y z],'FaceVertexCData',zeros(size(x)),'FaceColor','none','EdgeColor',edgecolor,'linewidth',linewidth);
27 patch( 'Faces', [D E F], 'Vertices', [x y z],'FaceVertexCData',zeros(size(x)),'FaceColor','none','EdgeColor',edgecolor,'linewidth',linewidth);
28 patch( 'Faces', [A B E D],'Vertices', [x y z],'FaceVertexCData',zeros(size(x)),'FaceColor','none','EdgeColor',edgecolor,'linewidth',linewidth);
29 patch( 'Faces', [B E F C],'Vertices', [x y z],'FaceVertexCData',zeros(size(x)),'FaceColor','none','EdgeColor',edgecolor,'linewidth',linewidth);
30 patch( 'Faces', [C A D F],'Vertices', [x y z],'FaceVertexCData',zeros(size(x)),'FaceColor','none','EdgeColor',edgecolor,'linewidth',linewidth);
31 else
32 A=elements(:,1); B=elements(:,2); C=elements(:,3);
33 if (size(elements,2)==4), D=elements(:,4); else D=C; end
34 patch( 'Faces', [A B C D], 'Vertices', [x y z],'FaceVertexCData',zeros(size(x)),'FaceColor','none','EdgeColor',edgecolor,'linewidth',linewidth);
35 end
36end
37
38%apply options
39options=addfielddefault(options,'title','Mesh');
40options=addfielddefault(options,'colorbar',0);
41applyoptions(md,[],options);
Note: See TracBrowser for help on using the repository browser.