0001 function plot_gridnumbering(md,options_structure,width,i);
0002
0003
0004
0005
0006
0007
0008
0009
0010 [x y z elements is2d]=processmesh(md,options_structure);
0011 [gridnumbers isongrid]=processdata(md,[1:md.numberofgrids]',options_structure);
0012
0013
0014 subplot(width,width,i);
0015
0016 if is2d
0017
0018 A=elements(:,1); B=elements(:,2); C=elements(:,3);
0019 patch( 'Faces', [A B C], 'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
0020 for i=1:length(gridnumbers)
0021 text(x(i),y(i), z(i),num2str(gridnumbers(i)),'backgroundcolor',[0.8 0.9 0.8]);
0022 end
0023 if ~isnan(options_structure.highlight),
0024 for i=1:length(options_structure.highlight)
0025 text(x(options_structure.highlight(i)),y(options_structure.highlight(i)), z(options_structure.highlight(i)),num2str(options_structure.highlight(i)),'backgroundcolor',[1 0 0]);
0026 end
0027 end
0028 else
0029
0030 A=elements(:,1); B=elements(:,2); C=elements(:,3); D=elements(:,4); E=elements(:,5); F=elements(:,6);
0031 patch( 'Faces', [A B C], 'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
0032 patch( 'Faces', [D E F], 'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
0033 patch( 'Faces', [A B E D], 'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
0034 patch( 'Faces', [B E F C ], 'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
0035 patch( 'Faces', [C A D F ], 'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
0036 for i=1:length(gridnumbers)
0037 text(x(i),y(i), z(i),num2str(i),'backgroundcolor',[0.8 0.9 0.8]);
0038 end
0039 if ~isnan(options_structure.highlight),
0040 for i=1:length(options_structure.highlight)
0041 text(x(options_structure.highlight(i)),y(options_structure.highlight(i)), z(options_structure.highlight(i)),num2str(options_structure.highlight(i)),'backgroundcolor',[1 0 0]);
0042 end
0043 end
0044 end
0045
0046
0047 if isnan(options_structure.title)
0048 options_structure.title='Grid numbering';
0049 end
0050 if isnan(options_structure.colorbar)
0051 options_structure.colorbar=0;
0052 end
0053 applyoptions(md,[],options_structure);