577
|
1 classdef EmptyGrid < grid.Grid
|
|
2 properties
|
|
3 dim
|
|
4 end
|
|
5
|
|
6 methods
|
|
7 function obj = EmptyGrid(D)
|
|
8 obj.dim = D;
|
|
9 end
|
|
10 % n returns the number of points in the grid
|
|
11 function o = N(obj)
|
|
12 o = 0;
|
|
13 end
|
|
14
|
|
15 % d returns the spatial dimension of the grid
|
|
16 function o = D(obj)
|
|
17 o = obj.dim;
|
|
18 end
|
|
19
|
|
20 % points returns a n x d matrix containing the coordinates for all points.
|
|
21 function X = points(obj)
|
|
22 X = sparse(0,obj.dim);
|
|
23 end
|
|
24
|
|
25 % Restricts the grid function gf on obj to the subgrid g.
|
|
26 function gf = restrictFunc(obj, gf, g)
|
|
27 error('Restrict does not make sense for an empty grid')
|
|
28 end
|
|
29
|
|
30 % Projects the grid function gf on obj to the grid g.
|
|
31 function gf = projectFunc(obj, gf, g)
|
|
32 error('Project does not make sense for an empty grid')
|
|
33 end
|
|
34
|
|
35 % Return the grid.boundaryIdentifiers of all boundaries in a cell array.
|
|
36 function bs = getBoundaryNames(obj)
|
|
37 bs = {};
|
|
38 end
|
|
39
|
|
40 % Return coordinates for the given boundary
|
|
41 function b = getBoundary(obj, name)
|
|
42 b = sparse(0,obj.dim-1);
|
|
43 end
|
|
44 end
|
|
45 end |