[20500] | 1 | function h2 = plot_icefront(md,options,width,i,data)
|
---|
[11249] | 2 | %PLOT_ICEFRONT - plot segment on neumann BC
|
---|
[1758] | 3 | %
|
---|
| 4 | % Usage:
|
---|
[11249] | 5 | % plot_icefront(md,options,width,i);
|
---|
[1758] | 6 | %
|
---|
| 7 | % See also: PLOTMODEL
|
---|
| 8 |
|
---|
| 9 | %plot mesh boundaries
|
---|
| 10 | subplot(width,width,i);
|
---|
| 11 |
|
---|
| 12 | %process mesh and data
|
---|
[8472] | 13 | [x y z elements is2d isplanet]=processmesh(md,[],options);
|
---|
[17806] | 14 | ice=(md.mask.ice_levelset<0);
|
---|
| 15 | noice=(md.mask.ice_levelset>=0);
|
---|
[16137] | 16 | zeroice=(md.mask.ice_levelset==0);
|
---|
| 17 | elementice=sum(ice(md.mesh.elements),2);
|
---|
| 18 | elementnoice=sum(noice(md.mesh.elements),2);
|
---|
| 19 | elementzeroice=sum(zeroice(md.mesh.elements),2);
|
---|
[1758] | 20 |
|
---|
[21729] | 21 | if is2d,
|
---|
[16137] | 22 | icefront=(elementice & elementnoice) & ~(elementice==2 & elementzeroice);
|
---|
[1758] | 23 |
|
---|
| 24 | %plot mesh
|
---|
| 25 | A=elements(:,1); B=elements(:,2); C=elements(:,3);
|
---|
| 26 | h1=patch( 'Faces', [A B C], 'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
|
---|
| 27 | hold on;
|
---|
| 28 |
|
---|
[3103] | 29 | %highlight elements on neumann
|
---|
[16137] | 30 | pos=find(icefront);
|
---|
[1758] | 31 | A=elements(pos,1); B=elements(pos,2); C=elements(pos,3);
|
---|
[3103] | 32 | h2=patch( 'Faces', [A B C], 'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','blue','EdgeColor','black');
|
---|
[16137] | 33 | hold on;
|
---|
[1758] | 34 |
|
---|
[16137] | 35 | %Plot zero ice_levelset line
|
---|
[7315] | 36 |
|
---|
[1758] | 37 | else
|
---|
[16137] | 38 | icefront=(elementice & elementnoice) & ~(elementice==4 & elementzeroice);
|
---|
[1758] | 39 |
|
---|
| 40 | %plot mesh
|
---|
| 41 | A=elements(:,1); B=elements(:,2); C=elements(:,3); D=elements(:,4); E=elements(:,5); F=elements(:,6);
|
---|
[5617] | 42 | h1=patch( 'Faces', [A B C],'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
|
---|
| 43 | patch( 'Faces', [D E F], 'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
|
---|
| 44 | patch( 'Faces', [A B E D],'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
|
---|
| 45 | patch( 'Faces', [B E F C],'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
|
---|
| 46 | patch( 'Faces', [C A D F],'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
|
---|
[1758] | 47 | hold on;
|
---|
| 48 |
|
---|
[3103] | 49 | %highlight elements on neumann
|
---|
[16137] | 50 | pos=find(icefront);
|
---|
[1758] | 51 | A=elements(pos,1); B=elements(pos,2); C=elements(pos,3); D=elements(pos,4); E=elements(pos,5); F=elements(pos,6);
|
---|
[5617] | 52 | h2=patch( 'Faces', [A B C],'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','blue','EdgeColor','black');
|
---|
| 53 | patch( 'Faces', [D E F], 'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','blue','EdgeColor','black');
|
---|
| 54 | patch( 'Faces', [A B E D],'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','blue','EdgeColor','black');
|
---|
| 55 | patch( 'Faces', [B E F C],'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','blue','EdgeColor','black');
|
---|
| 56 | patch( 'Faces', [C A D F],'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','blue','EdgeColor','black');
|
---|
[1758] | 57 | end
|
---|
| 58 |
|
---|
[2513] | 59 | %legend (disable warnings)
|
---|
| 60 | warning off
|
---|
[16137] | 61 | legend([h2],'element on ice front')
|
---|
[2513] | 62 | warning on
|
---|
[1758] | 63 |
|
---|
| 64 | %apply options
|
---|
[2439] | 65 | options=addfielddefault(options,'title','Neumann boundary conditions');
|
---|
| 66 | options=addfielddefault(options,'colorbar',0);
|
---|
| 67 | applyoptions(md,[],options);
|
---|