rbmatlab  1.16.09
 All Classes Namespaces Files Functions Variables Modules Pages
inspect.m
1 function inspect(grid, params)
2 %function inspect(grid, params)
3 % function plotting various properties of the current grid.
4 %
5 % The following plots are generated:
6 % - element numbers
7 % - the neighbour types and
8 % - neighbour indices
9 % - cog-coordinates
10 % - edge-midpoint-coordinates
11 %
12 % Parameters:
13 % params: structure holding control fields for the functions
14 % plot_element_data() and plot_sequence() used by this method.
15 
16 % Bernard Haasdonk 9.5.2007
17 
18 %set element-data plot function for sequence plots
19 
20 params.title = 'element indices';
21 params.plot = @plot_element_data;
22 plot_sequence((1:grid.nelements)',grid,params);
23 %plot_fv_data([1:grid.nelements; 1:grid.nelements]', params, ...
24 % 'element indices');
25 
26 params.title = 'boundary types';
27 plot_sequence(grid.NBI.*(grid.NBI<0),grid,params);
28 %plot_fv_data(grid.NBI.*(grid.NBI<0), params, ...
29 % 'boundary types');
30 
31 params.title = 'neighbour indices';
32 plot_sequence(grid.NBI,grid,params);
33 %plot_fv_data(grid.NBI, params, ...
34 % 'neigbour indices');
35 
36 params.title = 'cog coordinates';
37 plot_sequence([grid.CX,grid.CY],grid,params);
38 %plot_fv_data([grid.CX,grid.CY], params, ...
39 % 'cog coordinates');
40 
41 params.title = 'edge midpoint x-coordinates';
42 plot_sequence(grid.ECX,grid,params);
43 %plot_fv_data([grid.ECX], params, ...
44 % 'edge midpoint x-coordinates');
45 
46 params.title = 'edge midpoint y-coordinates';
47 plot_sequence(grid.ECY,grid,params);
48 %plot_fv_data([grid.ECY], params, ...
49 % 'edge midpoint y-coordinates');
50 
51 % additional check of consistency
52 %res = check_consistency(grid);
53 
54 figure;
55 subplot(2,2,1),plot(grid);
56 hold on, plot(grid.CX,grid.CY,'or');
57 title('centroids')
58 
59 subplot(2,2,2),plot(grid);
60 hold on, plot(grid.SX,grid.SY,'ob');
61 title('circumcenters')
62 
63 subplot(2,2,3),plot(grid);
64 hold on, plot(grid.ECX(:),grid.ECY(:),'og');
65 title('edge centroids')
66 
67 subplot(2,2,4),plot(grid);
68 hold on, plot(grid.ESX(:),grid.ESY(:),'ok');
69 title('circumcenter-edge intersections')
70 
71 
function p = plot_sequence(varargin)
plotting a sequence of data slices on polygonal 2d grid (constructed from params if empty) and provid...
Definition: plot_sequence.m:17