| MESH toolbox 0.1 Matlab/Octave mesh utils

- Main Page
- Related Pages
- Modules
- Files

- File List
- File Members

All Files Functions Groups Pages
LoM_demo1.m
Go to the documentation of this file.
1 function LoM_demo1(varargin)
2 % function LoM_demo1
3 % demo function using plot commands on List of Meshes.
4 % Before first use, generate FreeFEM++ meshes : in 'mesh' directory
5 % - under Matlab
6 % @verbatim !make Ring3x3_C @endverbatim
7 % - under Linux shell
8 % @verbatim make Ring3x3_C @endverbatim
9 %
10 % Parameters:
11 % save : set to true to save figures in image directory.
12 % percent : set png image resize percent
13 % basename : set basename mesh fileses
14 % labeldom : list of label domains
15 % refine : indice of refinement
16 %
17 % See also:
18 % FreeFEM++ edp files and Makefile in 'mesh' directory
19 %
20 % Examples:
21 % - @verbatim
22 % LoM_demo1()@endverbatim
23 % \image html images/MultiPlotMesh_Ring3x3_C.png "figure : LoM_demo1() meshes plot"
24 % \image html images/MultiPlotBounds_Ring3x3_C.png "figure : LoM_demo1() boundaries plot"
25 % - @verbatim
26 % LoM_demo1('basename','RectTroue12_C','labeldom',0:11,'refine',randi(5,1,12))@endverbatim
27 % \image html images/MultiPlotMesh_RectTroue12_C.png "figure : \'RectTroue12_C\' meshes plot"
28 % \image html images/MultiPlotBounds_RectTroue12_C.png "figure : \'RectTroue12_C\' boundaries plot"
29 % - @verbatim
30 % LoM_demo1('basename','RectTroue12_NC','labeldom',0:11,'refine',randi(5,1,12))@endverbatim
31 % \image html images/MultiPlotMesh_RectTroue12_NC.png "figure : \'RectTroue12_NC\' meshes plot"
32 % \image html images/MultiPlotBounds_RectTroue12_NC.png "figure : \'RectTroue12_NC\' boundaries plot"
33 p = inputParser;
34 %
35 p.addParamValue('save', false, @islogical );
36 p.addParamValue('percent', 50 , @(t) ((t>0)&&(t<=100)) );
37 p.addParamValue('basename','Ring3x3_C', @isstr );
38 p.addParamValue('labeldom',0:8, @isnumeric );
39 p.addParamValue('refine',2,@isnumeric);
40 p.parse(varargin{:});
41
42 close all
43
44 addpath('base')
45 addpath('graphic')
46
47 if length(p.Results.refine)==1
48 a=p.Results.refine*ones(1,length(p.Results.labeldom));
49 else
50 a=p.Results.refine;
51 end
52 DirName=['mesh',filesep,p.Results.basename,filesep];
53 for k=1:length(p.Results.labeldom)
54 FileMesh=sprintf('%s%s%d_%d.msh',DirName,p.Results.basename,p.Results.labeldom(k),a(k));
55 LoM(k)=GetMeshOpt(FileMesh);
56 end
57
58 figure(1)
59 MultiPlotMesh(LoM,'colormap','jet','Label',true);
60 SaveImage(p.Results.save,['MultiPlotMesh_',p.Results.basename],p.Results.percent)
61
62 figure(2)
63 MultiPlotBounds(LoM,'colormap','HSV','Label',true);
64 SaveImage(p.Results.save,['MultiPlotBounds_',p.Results.basename],p.Results.percent)
65