comparison +grid/Empty.m @ 707:0de70ec8bf60 feature/quantumTriangles

merge with feature/optim
author Ylva Rydin <ylva.rydin@telia.com>
date Fri, 10 Nov 2017 14:22:56 +0100
parents ce44af8d7dd1
children
comparison
equal deleted inserted replaced
696:7c16b5af8d98 707:0de70ec8bf60
1 classdef Empty < grid.Grid & grid.Structured
2 properties
3 dim
4 end
5
6 methods
7 function obj = Empty(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
45 function h = scaling(obj)
46 h = 1;
47 end
48
49 function s = size(obj)
50 s = zeros(1, obj.dim);
51 end
52 end
53 end