source: issm/trunk/src/m/classes/public/plot/plot_rifts.m@ 2694

Last change on this file since 2694 was 2694, checked in by Eric.Larour, 15 years ago

Added plot_rifts routine

File size: 1.9 KB
Line 
1function plot_rifts(md,options,width,i);
2%PLOT_RIFTVEL - plot rifts in a mesh
3%
4% Usage:
5% plot_rifts(md,options,width,i);
6%
7% See also: PLOTMODEL
8
9%plot mesh boundaries
10subplot(width,width,i);
11
12%units
13if exist(options,'unit'),
14 unit=getfieldvalue(options,'unit');
15 md.x=md.x*unit;
16 md.y=md.y*unit;
17 md.z=md.z*unit;
18end
19
20if exist(options,'offset'),
21 offset=getfieldvalue(options,'offset');
22else
23 offset=500;
24end
25
26
27%plot rifts
28hold on;
29
30isp1=0;
31isp2=0;
32
33%offset to separate rift flanks.
34
35if isstruct(md.rifts),
36
37 for i=1:size(md.rifts,1),
38 penaltypairs=md.rifts(i).penaltypairs;
39
40 normal=zeros(2,1);
41 for j=1:size(penaltypairs,1),
42 normal(1)=penaltypairs(j,5);
43 normal(2)=penaltypairs(j,6);
44 md.x(penaltypairs(j,1))=md.x(penaltypairs(j,1))-normal(1)*offset;
45 md.y(penaltypairs(j,1))=md.y(penaltypairs(j,1))-normal(2)*offset;
46 end
47 end
48end
49
50%process data and model
51[x y z elements is2d]=processmesh(md,options);
52
53%plot mesh
54subplot(width,width,i);
55
56%plot mesh
57if is2d
58 A=elements(:,1); B=elements(:,2); C=elements(:,3);
59 patch( 'Faces', [A B C], 'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
60else
61 A=elements(:,1); B=elements(:,2); C=elements(:,3); D=elements(:,4); E=elements(:,5); F=elements(:,6);
62 patch( 'Faces', [A B C], 'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
63 patch( 'Faces', [D E F], 'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
64 patch( 'Faces', [A B E D], 'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
65 patch( 'Faces', [B E F C ], 'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
66 patch( 'Faces', [C A D F ], 'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
67end
68
69
70%apply options
71options=addfielddefault(options,'title','Rifts');
72options=addfielddefault(options,'colorbar',0);
73applyoptions(md,[],options);
Note: See TracBrowser for help on using the repository browser.