| MESH toolbox 0.1 Matlab/Octave mesh utils

- Main Page
- Related Pages
- Modules
- Files

- File List
- File Members

All Files Functions Groups Pages
numbering_demo1.m
Go to the documentation of this file.
1 function numbering_demo1(varargin)
2 % function numbering_demo1
3 % code using basic mesh plot command.
4 %
5 % Parameters:
6 % save : set to true to save figures in image directory.
7 % percent : set color mesh lines
8 % meshfile : set mesh file name
9 %
10 % Examples:
11 % @verbatim numbering_demo1('save',true,'percent',30)@endverbatim
12 % - figure(1) : plot mesh nodes numbers
13 % \image html images/PlotMeshNodeNumber.png "figure(1) : PlotMeshNodeNumber(Th,\'Color\',[1 0 0],\'FontSize\',8)"
14 % - figure(2) : plot mesh triangles numbers
15 % \image html images/PlotMeshTriangleNumber.png "figure(2) : PlotMeshTriangleNumber(Th,\'Color\',[1 0 0],\'FontSize\',8)"
16 % - figure(3) : plot mesh nodes and triangles numbers
17 % \image html images/PlotMeshNodeAndTriangleNumber.png "figure(3) : PlotMeshNodeNumber and PlotMeshTriangleNumber"
18 % - figure(4) : plot mesh boundary edges numbers
19 % \image html images/PlotBoundsEdgeNumber1.png "figure(4) : PlotBoundsEdgeNumber sample 1"
20 % - figure(5) : plot mesh boundary edges numbers
21 % \image html images/PlotBoundsEdgeNumber2.png "figure(5) : PlotBoundsEdgeNumber sample 2"
22 % - figure(6) : plot all mesh numbers
23 % \image html images/PlotAllNumbers.png "figure(5) : use all numbers functions"
24 % See also:
25 % #PlotMesh, #PlotBounds, #PlotMeshNodeNumber, #PlotMeshTriangleNumber, #PlotBoundsEdgeNumber
26 p = inputParser;
27 %
28 p.addParamValue('save', false, @islogical );
29 p.addParamValue('percent', 50 , @(t) ((t>0)&&(t<=100)) );
30 p.addParamValue('meshfile',['mesh',filesep,'disque4-1-5.msh'], @isstr );
31 p.parse(varargin{:});
32
33 close all
34
35 addpath('base');
36 addpath('graphic');
37 Th=GetMeshOpt(p.Results.meshfile);
38
39 figure(1)
40 PlotMesh(Th,'Color',[0 0 0]);
41 PlotMeshNodeNumber(Th,'Color',[0 0 1],'FontSize',8)
42 SaveImage(p.Results.save,'PlotMeshNodeNumber',p.Results.percent)
43 title(['Filename : ',p.Results.meshfile])
44
45 figure(2)
46 PlotMesh(Th,'Color',[0 0 0]);
47 PlotMeshTriangleNumber(Th,'Color',[1 0 0],'FontSize',8)
48 SaveImage(p.Results.save,'PlotMeshTriangleNumber',p.Results.percent)
49 title(['Filename : ',p.Results.meshfile])
50
51 figure(3)
52 PlotMesh(Th,'Color',[0 0 0]);
53 PlotMeshNodeNumber(Th,'Color',[0 0 1],'FontSize',8)
54 PlotMeshTriangleNumber(Th,'Color',[1 0 0],'FontSize',8)
55 SaveImage(p.Results.save,'PlotMeshNodeAndTriangleNumber',p.Results.percent)
56 title(['Filename : ',p.Results.meshfile])
57
58 figure(4)
59 PlotMesh(Th,'Color',[0 0 0]);
60 PlotBoundsEdgeNumber(Th,'EdgeColor',[1 0 0],'Color',[0 0 0],'LineStyle','-','LineWidth',0.5);
61 SaveImage(p.Results.save,'PlotBoundsEdgeNumber1',p.Results.percent)
62 title(['Filename : ',p.Results.meshfile])
63
64 figure(5)
65 PlotMesh(Th,'Color',[0 0 0]);
66 RGBcolors=PlotBounds(Th,'LineWidth',2);
67 PlotBoundsEdgeNumber(Th,'RGBEdgeColors',RGBcolors,'Color',[0 0 0],'LineStyle','-','LineWidth',0.5);
68 SaveImage(p.Results.save,'PlotBoundsEdgeNumber2',p.Results.percent)
69 title(['Filename : ',p.Results.meshfile])
70
71 figure(6)
72 PlotMesh(Th,'Color',[0 0 0]);
73 RGBcolors=PlotBounds(Th,'LineWidth',2);
74 PlotBoundsEdgeNumber(Th,'RGBEdgeColors',RGBcolors,'Color',[0 0 0],'LineStyle','-','LineWidth',0.5,'FontSize',8);
75 PlotMeshNodeNumber(Th,'Color',[0 0 1],'FontSize',8)
76 PlotMeshTriangleNumber(Th,'Color',[1 0 0],'FontSize',8)
77 SaveImage(p.Results.save,'PlotAllNumbers',p.Results.percent)
78 title(['Filename : ',p.Results.meshfile])