rbmatlab  1.16.09
 All Classes Namespaces Files Functions Variables Modules Pages
gridbase.m
1 classdef gridbase < handle
2  % Base class for all grid classes
3  %
4 
5  properties
6 
7  nelements; % number of overall elements (leaf + nonleaf)
8 
9  nvertices; % number of vertices
10 
11  nneigh; % number of neighbor elements
12 
13  A; % vector of element area
14 
15  Ainv; % vector of inverted element area
16 
17  % matrix of vertex indices: 'VI(i,j)' is the global index of
18  % 'j'-th vertex of element 'i'
19  VI;
20 
21  X; % vector of vertex x-coordinates
22 
23  Y; % vector of vertex y-coordinates
24 
25  CX; % vector of centroid x-values
26 
27  CY; % vector of centroid y-values
28 
29  % 'NBI(i,j)' = element index of 'j'-th neighbour of element 'i'
30  % boundary faces are set to -1 or negative values are requested
31  % by 'params.boundary_type'
32  NBI;
33 
34  % 'INB(i,j)' = local edge number in 'NBI(i,j)' leading from
35  % element 'NBI(i,j)' to element 'i', i.e. satisfying
36  % 'NBI(NBI(i,j), INB(i,j)) = i'
37  INB;
38 
39  % 'EL(i,j)' = length of edge from element 'i' to neighbour 'j'
40  EL;
41 
42  % 'DC(i,j)' = distance from centroid of element 'i' to NB 'j'
43  % for boundary elements, this is the distance to the reflected
44  % element (for use in boundary treatment)
45  DC;
46 
47  % 'NX(i,j)' = x-coordinate of unit outer normal of edge from el
48  % 'i' to NB 'j'
49  NX;
50 
51  % 'NY(i,j)' = y-coordinate of unit outer normal of edge from el
52  % 'i' to NB 'j'
53  NY;
54 
55  % 'ECX(i,j)' = x-coordinate of midpoint of edge from el 'i' to
56  % NB 'j'
57  ECX;
58 
59  % 'ECY(i,j)' = x-coordinate of midpoint of edge from el 'i' to
60  % NB 'j'
61  ECY;
62 
63  % vector of x-coordinates of point `S_i` (for rect: identical to
64  % centroids)
65  %
66  % for diffusion-discretization with FV-schemes, points `S_i`
67  % must exist, such that `S_i S_j` is perpendicular to edge `i j`
68  % the intersection are denoted `S_ij`
69  SX;
70 
71  % vector of y-coordinates of point `S_i` (for rect: identical to
72  % centroids)
73  %
74  % for diffusion-discretization with FV-schemes, points `S_i`
75  % must exist, such that `S_i S_j` is perpendicular to edge `i j`
76  % the intersection are denoted `S_ij`
77  SY;
78 
79  % 'ESX(i,j)' = x-coordinate of point `S_ij` on edge el 'i' to
80  % NB 'j'
81  ESX;
82 
83  % 'ESY(i,j)' = x-coordinate of point `S_ij` on edge el 'i' to
84  % NB 'j'
85  ESY;
86 
87  % 'DS(i,j)' = distance from `S_i` of element 'i' to `S_j` of NB
88  % 'j' for boundary elements, this is the distance to the
89  % reflected element (for use in boundary treatment)
90  DS;
91 
92  hmin; % minimal element-diameter
93 
94  % geometry bound (simultaneously satisfying
95  % ``\alpha h_i^d \leq A(T_i),``
96  % ``\alpha \text{diam}(T_i) \leq h_i^{d-1}`` and
97  % ``\alpha h_i \leq \text{distance(midpoint i to any neighbour)}``
98  alpha;
99 
100  % Jacobian inverse transposed 'JIT(i,:,:)' is a '2x2'-matrix of
101  % the Jacobian Inverse Transposed on element 'i'
102  JIT;
103 
104  end
105 
106  methods
107 
108  function obj = gridbase
109  % default constructor for gridbase
110  end
111 
113  res = check_consistency(grid);
114 
115  display(grid);
116 
117  F = edge_quad_eval(grid,elids,edgeids,degree,FF);
118 
119  F = edge_quad_eval_mean(grid,elids,edgeids,degree,FF);
120 
121  PP = edge_quad_points(grid,elids,edgeids,degree);
123  [P1, P2] = get_edge_points(grid,elids,edgeids);
124 
125  ENBI = get_enbi(grid, edge, tstep);
126 
127  gridp=gridpart(grid, eind);
128 
129  inspect(grid, params);
131  p = plot_polygon_grid(grid,params);
132 
133  p = plot_element_data(grid,data,plot_params);
134 
135  plot_element_data_sequence(grid,data,plot_params);
136 
137  p = plot_vertex_data(grid,data,params);
138 
139  grid = set_boundary_types(grid,params);
141  end
142 
143  methods(Abstract)
144 
145  gcopy = copy(grid);
146  % returns a deep copy object of the grid implementation
147  %
148  % Every grid implementations needs to provide a deep copy method, because
149  % it is derived from a handle class.
150  %
151  % Return values:
152  % gcopy: Deep copy of type gridbase.
153 
154  end
155 
156 end
Definition: leaf.m:17
Base class for all grid classes.
Definition: gridbase.m:17