Mercurial > repos > public > sbplib
annotate +grid/Empty.m @ 774:66eb4a2bbb72 feature/grids
Remove default scaling of the system.
The scaling doens't seem to help actual solutions. One example that fails in the flexural code.
With large timesteps the solutions seems to blow up. One particular example is profilePresentation
on the tdb_presentation_figures branch with k = 0.0005
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Wed, 18 Jul 2018 15:42:52 -0700 |
parents | ce44af8d7dd1 |
children |
rev | line source |
---|---|
582
ce44af8d7dd1
Rename grid.EmptyGrid to grid.Empty
Jonatan Werpers <jonatan@werpers.com>
parents:
577
diff
changeset
|
1 classdef Empty < grid.Grid & grid.Structured |
577 | 2 properties |
3 dim | |
4 end | |
5 | |
6 methods | |
582
ce44af8d7dd1
Rename grid.EmptyGrid to grid.Empty
Jonatan Werpers <jonatan@werpers.com>
parents:
577
diff
changeset
|
7 function obj = Empty(D) |
577 | 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 | |
582
ce44af8d7dd1
Rename grid.EmptyGrid to grid.Empty
Jonatan Werpers <jonatan@werpers.com>
parents:
577
diff
changeset
|
44 |
ce44af8d7dd1
Rename grid.EmptyGrid to grid.Empty
Jonatan Werpers <jonatan@werpers.com>
parents:
577
diff
changeset
|
45 function h = scaling(obj) |
ce44af8d7dd1
Rename grid.EmptyGrid to grid.Empty
Jonatan Werpers <jonatan@werpers.com>
parents:
577
diff
changeset
|
46 h = 1; |
ce44af8d7dd1
Rename grid.EmptyGrid to grid.Empty
Jonatan Werpers <jonatan@werpers.com>
parents:
577
diff
changeset
|
47 end |
ce44af8d7dd1
Rename grid.EmptyGrid to grid.Empty
Jonatan Werpers <jonatan@werpers.com>
parents:
577
diff
changeset
|
48 |
ce44af8d7dd1
Rename grid.EmptyGrid to grid.Empty
Jonatan Werpers <jonatan@werpers.com>
parents:
577
diff
changeset
|
49 function s = size(obj) |
ce44af8d7dd1
Rename grid.EmptyGrid to grid.Empty
Jonatan Werpers <jonatan@werpers.com>
parents:
577
diff
changeset
|
50 s = zeros(1, obj.dim); |
ce44af8d7dd1
Rename grid.EmptyGrid to grid.Empty
Jonatan Werpers <jonatan@werpers.com>
parents:
577
diff
changeset
|
51 end |
577 | 52 end |
53 end |