[3202] | 1 | function plot_rifpenetration(md,options,nlines,ncols,index);
|
---|
[1] | 2 | %PLOT_RIFTPENETRATION - plot rift penetration
|
---|
| 3 | %
|
---|
| 4 | % Usage:
|
---|
[2439] | 5 | % plot_rifpenetration(md,options,width,i);
|
---|
[1] | 6 | %
|
---|
| 7 | % See also: PLOTMODEL
|
---|
| 8 |
|
---|
[2695] | 9 | %process data and model
|
---|
[8472] | 10 | [x y z elements is2d isplanet]=processmesh(md,[],options);
|
---|
[2695] | 11 |
|
---|
[3202] | 12 | subplot(nlines,ncols,index);
|
---|
[2695] | 13 | hold on
|
---|
[1] | 14 |
|
---|
[2695] | 15 | %plot mesh boundaries
|
---|
[9714] | 16 | for i=1:size(md.mesh.segments,1),
|
---|
| 17 | plot(x(md.mesh.segments(i,1:2)),y(md.mesh.segments(i,1:2)),'k-');
|
---|
[1] | 18 | end
|
---|
| 19 |
|
---|
| 20 | isp1=0;
|
---|
| 21 | isp2=0;
|
---|
| 22 |
|
---|
[9619] | 23 | if isstruct(md.rifts.riftstruct),
|
---|
[1] | 24 | %plot mesh boundaries
|
---|
[9714] | 25 | for i=1:size(md.mesh.segments,1),
|
---|
| 26 | h1=plot(x(md.mesh.segments(i,1:2)),y(md.mesh.segments(i,1:2)),'b-');
|
---|
[1] | 27 | end
|
---|
[9619] | 28 | for i=1:size(md.rifts.riftstruct,1),
|
---|
| 29 | penaltypairs=md.rifts.riftstruct(i).penaltypairs;
|
---|
[1] | 30 |
|
---|
[9619] | 31 | segments=md.rifts.riftstruct(i).segments;
|
---|
[1] | 32 | for j=1:size(segments,1),
|
---|
[2695] | 33 | plot(x(segments(j,1:2)),y(segments(j,1:2)),'b-');
|
---|
[1] | 34 | end
|
---|
| 35 |
|
---|
| 36 | normal=zeros(2,1);
|
---|
| 37 | for j=1:size(penaltypairs,1),
|
---|
| 38 | normal(1)=penaltypairs(j,5);
|
---|
| 39 | normal(2)=penaltypairs(j,6);
|
---|
| 40 |
|
---|
[9684] | 41 | vx1=md.initialization.vx(penaltypairs(j,1));
|
---|
| 42 | vx2=md.initialization.vx(penaltypairs(j,2));
|
---|
| 43 | vy1=md.initialization.vy(penaltypairs(j,1));
|
---|
| 44 | vy2=md.initialization.vy(penaltypairs(j,2));
|
---|
[1] | 45 | penetration=(vx2-vx1)*normal(1)+(vy2-vy1)*normal(2);
|
---|
| 46 | %if penetration is negative, plot in black, positive, plot in red;: ie: if rift is closing, black, if rift is opening, red.
|
---|
| 47 | if(penetration>0),
|
---|
[6365] | 48 | p2=plot(x(penaltypairs(j,1)) ,y(penaltypairs(j,1)),'ro-','LineWidth',1);
|
---|
[6651] | 49 | set(p2,'MarkerSize',3);
|
---|
[1] | 50 | isp2=1;
|
---|
| 51 | else
|
---|
[6365] | 52 | p1=plot(x(penaltypairs(j,1)) ,y(penaltypairs(j,1)),'ko-','LineWidth',1);
|
---|
[6651] | 53 | set(p1,'MarkerSize',3);
|
---|
[1] | 54 | isp1=1;
|
---|
| 55 | end
|
---|
| 56 | end
|
---|
| 57 |
|
---|
| 58 | %point out the tips
|
---|
[9619] | 59 | h2=plot(x(md.rifts.riftstruct(i).tips(1)),y(md.rifts.riftstruct(i).tips(1)),'g*');
|
---|
| 60 | plot(x(md.rifts.riftstruct(i).tips(2)),y(md.rifts.riftstruct(i).tips(2)),'g*');
|
---|
[1] | 61 | end
|
---|
[6286] | 62 | if strcmpi(getfieldvalue(options,'legend','on'),'on'),
|
---|
| 63 | if isp1 & isp2
|
---|
| 64 | l=legend([h1,h2,p1,p2],'mesh boundaries','crack tips','faults','rifts');
|
---|
| 65 | elseif isp1
|
---|
| 66 | l=legend([h1,h2,p1],'mesh boundaries','crack tips','faults');
|
---|
| 67 | elseif isp2
|
---|
| 68 | l=legend([h1,h2,p2],'mesh boundaries','crack tips','rifts');
|
---|
| 69 | else
|
---|
| 70 | l=legend([h1,h2],'mesh boundaries','crack tips');
|
---|
| 71 | end
|
---|
| 72 | set(l,'Location',getfieldvalue(options,'legend_location','NorthEast'));
|
---|
[1] | 73 | end
|
---|
| 74 | else
|
---|
| 75 | error('plot error message: no rifts available!');
|
---|
| 76 | end
|
---|
[2695] | 77 | hold off
|
---|
[1] | 78 |
|
---|
| 79 | %apply options
|
---|
[6286] | 80 | options=addfielddefault(options,'title','Rift/Fault location');
|
---|
[2439] | 81 | options=addfielddefault(options,'colorbar',0);
|
---|
| 82 | applyoptions(md,[],options);
|
---|