Mercurial > repos > public > sbplib
annotate +sbp/D2BlockNorm.m @ 262:23051a86faa4 operator_remake
Removed static method smallestGrid
author | Martin Almquist <martin.almquist@it.uu.se> |
---|---|
date | Thu, 08 Sep 2016 15:37:48 +0200 |
parents | 6009f2712d13 |
children | 21a180acbd49 |
rev | line source |
---|---|
252
07fa0d6a05bb
Renamned class files and added nonequidistant operators.
Martin Almquist <martin.almquist@it.uu.se>
parents:
diff
changeset
|
1 classdef D2BlockNorm < sbp.OpSet |
07fa0d6a05bb
Renamned class files and added nonequidistant operators.
Martin Almquist <martin.almquist@it.uu.se>
parents:
diff
changeset
|
2 properties |
07fa0d6a05bb
Renamned class files and added nonequidistant operators.
Martin Almquist <martin.almquist@it.uu.se>
parents:
diff
changeset
|
3 norms % Struct containing norm matrices such as H,Q, M |
07fa0d6a05bb
Renamned class files and added nonequidistant operators.
Martin Almquist <martin.almquist@it.uu.se>
parents:
diff
changeset
|
4 boundary % Struct contanging vectors for boundry point approximations |
07fa0d6a05bb
Renamned class files and added nonequidistant operators.
Martin Almquist <martin.almquist@it.uu.se>
parents:
diff
changeset
|
5 derivatives % Struct containging differentiation operators |
07fa0d6a05bb
Renamned class files and added nonequidistant operators.
Martin Almquist <martin.almquist@it.uu.se>
parents:
diff
changeset
|
6 borrowing % Struct with borrowing limits for different norm matrices |
07fa0d6a05bb
Renamned class files and added nonequidistant operators.
Martin Almquist <martin.almquist@it.uu.se>
parents:
diff
changeset
|
7 m % Number of grid points. |
07fa0d6a05bb
Renamned class files and added nonequidistant operators.
Martin Almquist <martin.almquist@it.uu.se>
parents:
diff
changeset
|
8 h % Step size |
07fa0d6a05bb
Renamned class files and added nonequidistant operators.
Martin Almquist <martin.almquist@it.uu.se>
parents:
diff
changeset
|
9 end |
07fa0d6a05bb
Renamned class files and added nonequidistant operators.
Martin Almquist <martin.almquist@it.uu.se>
parents:
diff
changeset
|
10 |
07fa0d6a05bb
Renamned class files and added nonequidistant operators.
Martin Almquist <martin.almquist@it.uu.se>
parents:
diff
changeset
|
11 |
07fa0d6a05bb
Renamned class files and added nonequidistant operators.
Martin Almquist <martin.almquist@it.uu.se>
parents:
diff
changeset
|
12 |
07fa0d6a05bb
Renamned class files and added nonequidistant operators.
Martin Almquist <martin.almquist@it.uu.se>
parents:
diff
changeset
|
13 methods |
07fa0d6a05bb
Renamned class files and added nonequidistant operators.
Martin Almquist <martin.almquist@it.uu.se>
parents:
diff
changeset
|
14 function obj = D2BlockNorm(m,h,order) |
07fa0d6a05bb
Renamned class files and added nonequidistant operators.
Martin Almquist <martin.almquist@it.uu.se>
parents:
diff
changeset
|
15 |
07fa0d6a05bb
Renamned class files and added nonequidistant operators.
Martin Almquist <martin.almquist@it.uu.se>
parents:
diff
changeset
|
16 if order == 4 |
261
6009f2712d13
Moved and renamned all implementations.
Martin Almquist <martin.almquist@it.uu.se>
parents:
252
diff
changeset
|
17 [H, HI, D1, D2, e_1, e_m, M, Q, S_1, S_m] = ... |
6009f2712d13
Moved and renamned all implementations.
Martin Almquist <martin.almquist@it.uu.se>
parents:
252
diff
changeset
|
18 sbp.implementations.d2_blocknorm_4(m,h); |
252
07fa0d6a05bb
Renamned class files and added nonequidistant operators.
Martin Almquist <martin.almquist@it.uu.se>
parents:
diff
changeset
|
19 elseif order == 6 |
261
6009f2712d13
Moved and renamned all implementations.
Martin Almquist <martin.almquist@it.uu.se>
parents:
252
diff
changeset
|
20 [H, HI, D1, D2, e_1, e_m, M, Q, S_1, S_m] = ... |
6009f2712d13
Moved and renamned all implementations.
Martin Almquist <martin.almquist@it.uu.se>
parents:
252
diff
changeset
|
21 sbp.implementations.d2_blocknorm_6(m,h); |
252
07fa0d6a05bb
Renamned class files and added nonequidistant operators.
Martin Almquist <martin.almquist@it.uu.se>
parents:
diff
changeset
|
22 elseif order == 8 |
261
6009f2712d13
Moved and renamned all implementations.
Martin Almquist <martin.almquist@it.uu.se>
parents:
252
diff
changeset
|
23 [H, HI, D1, D2, e_1, e_m, M, Q, S_1, S_m] = ... |
6009f2712d13
Moved and renamned all implementations.
Martin Almquist <martin.almquist@it.uu.se>
parents:
252
diff
changeset
|
24 sbp.implementations.d2_blocknorm_8(m,h); |
252
07fa0d6a05bb
Renamned class files and added nonequidistant operators.
Martin Almquist <martin.almquist@it.uu.se>
parents:
diff
changeset
|
25 elseif order == 10 |
261
6009f2712d13
Moved and renamned all implementations.
Martin Almquist <martin.almquist@it.uu.se>
parents:
252
diff
changeset
|
26 [H, HI, D1, D2, e_1, e_m, M, Q, S_1, S_m] = ... |
6009f2712d13
Moved and renamned all implementations.
Martin Almquist <martin.almquist@it.uu.se>
parents:
252
diff
changeset
|
27 sbp.implementations.d2_blocknorm_10(m,h); |
252
07fa0d6a05bb
Renamned class files and added nonequidistant operators.
Martin Almquist <martin.almquist@it.uu.se>
parents:
diff
changeset
|
28 else |
07fa0d6a05bb
Renamned class files and added nonequidistant operators.
Martin Almquist <martin.almquist@it.uu.se>
parents:
diff
changeset
|
29 error('Invalid operator order %d.',order); |
07fa0d6a05bb
Renamned class files and added nonequidistant operators.
Martin Almquist <martin.almquist@it.uu.se>
parents:
diff
changeset
|
30 end |
07fa0d6a05bb
Renamned class files and added nonequidistant operators.
Martin Almquist <martin.almquist@it.uu.se>
parents:
diff
changeset
|
31 |
07fa0d6a05bb
Renamned class files and added nonequidistant operators.
Martin Almquist <martin.almquist@it.uu.se>
parents:
diff
changeset
|
32 obj.h = h; |
07fa0d6a05bb
Renamned class files and added nonequidistant operators.
Martin Almquist <martin.almquist@it.uu.se>
parents:
diff
changeset
|
33 obj.m = m; |
07fa0d6a05bb
Renamned class files and added nonequidistant operators.
Martin Almquist <martin.almquist@it.uu.se>
parents:
diff
changeset
|
34 |
07fa0d6a05bb
Renamned class files and added nonequidistant operators.
Martin Almquist <martin.almquist@it.uu.se>
parents:
diff
changeset
|
35 obj.norms.H = H; |
07fa0d6a05bb
Renamned class files and added nonequidistant operators.
Martin Almquist <martin.almquist@it.uu.se>
parents:
diff
changeset
|
36 obj.norms.HI = HI; |
07fa0d6a05bb
Renamned class files and added nonequidistant operators.
Martin Almquist <martin.almquist@it.uu.se>
parents:
diff
changeset
|
37 obj.norms.Q = Q; |
07fa0d6a05bb
Renamned class files and added nonequidistant operators.
Martin Almquist <martin.almquist@it.uu.se>
parents:
diff
changeset
|
38 obj.norms.M = M; |
07fa0d6a05bb
Renamned class files and added nonequidistant operators.
Martin Almquist <martin.almquist@it.uu.se>
parents:
diff
changeset
|
39 |
07fa0d6a05bb
Renamned class files and added nonequidistant operators.
Martin Almquist <martin.almquist@it.uu.se>
parents:
diff
changeset
|
40 obj.boundary.e_1 = e_1; |
07fa0d6a05bb
Renamned class files and added nonequidistant operators.
Martin Almquist <martin.almquist@it.uu.se>
parents:
diff
changeset
|
41 obj.boundary.S_1 = S_1; |
07fa0d6a05bb
Renamned class files and added nonequidistant operators.
Martin Almquist <martin.almquist@it.uu.se>
parents:
diff
changeset
|
42 |
07fa0d6a05bb
Renamned class files and added nonequidistant operators.
Martin Almquist <martin.almquist@it.uu.se>
parents:
diff
changeset
|
43 obj.boundary.e_m = e_m; |
07fa0d6a05bb
Renamned class files and added nonequidistant operators.
Martin Almquist <martin.almquist@it.uu.se>
parents:
diff
changeset
|
44 obj.boundary.S_m = S_m; |
07fa0d6a05bb
Renamned class files and added nonequidistant operators.
Martin Almquist <martin.almquist@it.uu.se>
parents:
diff
changeset
|
45 |
07fa0d6a05bb
Renamned class files and added nonequidistant operators.
Martin Almquist <martin.almquist@it.uu.se>
parents:
diff
changeset
|
46 obj.derivatives.D1 = D1; |
07fa0d6a05bb
Renamned class files and added nonequidistant operators.
Martin Almquist <martin.almquist@it.uu.se>
parents:
diff
changeset
|
47 obj.derivatives.D2 = D2; |
07fa0d6a05bb
Renamned class files and added nonequidistant operators.
Martin Almquist <martin.almquist@it.uu.se>
parents:
diff
changeset
|
48 end |
07fa0d6a05bb
Renamned class files and added nonequidistant operators.
Martin Almquist <martin.almquist@it.uu.se>
parents:
diff
changeset
|
49 end |
07fa0d6a05bb
Renamned class files and added nonequidistant operators.
Martin Almquist <martin.almquist@it.uu.se>
parents:
diff
changeset
|
50 |
07fa0d6a05bb
Renamned class files and added nonequidistant operators.
Martin Almquist <martin.almquist@it.uu.se>
parents:
diff
changeset
|
51 |
07fa0d6a05bb
Renamned class files and added nonequidistant operators.
Martin Almquist <martin.almquist@it.uu.se>
parents:
diff
changeset
|
52 |
07fa0d6a05bb
Renamned class files and added nonequidistant operators.
Martin Almquist <martin.almquist@it.uu.se>
parents:
diff
changeset
|
53 end |