3 % small script demonstrating the possibilities of the
cubegrid
6 % Bernard Haasdonk 9.5.2007
8 % various dimensional grids and plot routine:
11 disp(
'plotting different dimensional grids and different plot modes')
12 params.range = {[0,1]};
13 params.numintervals = [10];
15 params.shrink_factor = 0.9;
16 params.plot_patch = 0;
17 subplot(1,3,1), plot(g1,params);
20 params.range = {[0,1],[0,2]};
21 params.numintervals = [2,4];
23 params.plot_patch = 0;
24 params.axis_equal = 1;
25 subplot(1,3,2), plot(g2);
28 params.range = {[0,1],[0,2],[1,2]};
29 params.numintervals = [2,2,2];
31 params.plot_patch = 1;
32 params.color = [0.5 0.5 0];
33 params.shrink_factor = 0.9;
34 subplot(1,3,3), plot(g3, params);
37 disp(
'press key to continue');
42 disp(
'demonstration of grid refinement')
44 % note: indices are
leaf-indices, no global element indices!!
45 g4 = refine(g2,[1,4]);
46 g4 = refine(g4,[5,6,7]);
47 g4 = refine(g4,[8,9,10]);
50 subplot(1,2,1),plot_leafelement_data(g4,
get(g4,
'leafelements'),params)
51 title('element ids of
leaf elements');
52 params.shrink_factor = 1;
53 subplot(1,2,2),plot_leafvertex_data(g4,1:get(g4,'nvertices'),params)
54 title('vertex ids of
leaf vertices');
56 disp('press key to continue');
60 disp('display method of grid:')
63 disp('press key to continue');
67 disp('get method of grid:')
A hierarchical cubegrid of arbitrary dimension.