Mercurial > repos > public > sbplib
annotate +sbp/Upwind.m @ 87:0a29a60e0b21
In Curve: Rearranged for speed. arc_length_fun is now a property of Curve. If it is not supplied, it is computed via the derivative and spline fitting. Switching to the arc length parameterization is much faster now. The new stuff can be tested with testArcLength.m (which should be deleted after that).
author | Martin Almquist <martin.almquist@it.uu.se> |
---|---|
date | Sun, 29 Nov 2015 22:23:09 +0100 |
parents | 4f5a65f49035 |
children | c56437d097de |
rev | line source |
---|---|
52
4f5a65f49035
Fixed the upwind operators.
Jonatan Werpers <jonatan@werpers.com>
parents:
47
diff
changeset
|
1 classdef Upwind < sbp.OpSet |
47 | 2 properties |
3 norms % Struct containing norm matrices such as H,Q, M | |
4 boundary % Struct contanging vectors for boundry point approximations | |
5 derivatives % Struct containging differentiation operators | |
6 borrowing % Struct with borrowing limits for different norm matrices | |
7 m % Number of grid points. | |
8 h % Step size | |
9 end | |
10 | |
11 methods | |
52
4f5a65f49035
Fixed the upwind operators.
Jonatan Werpers <jonatan@werpers.com>
parents:
47
diff
changeset
|
12 function obj = Upwind(m,h,order) |
47 | 13 |
14 if order == 3 | |
52
4f5a65f49035
Fixed the upwind operators.
Jonatan Werpers <jonatan@werpers.com>
parents:
47
diff
changeset
|
15 [H, HI, Dp, Dm, e_1, e_m] = sbp.upwind3_3bp(m,h); |
47 | 16 elseif order == 4 |
17 [H, HI, Dp, Dm, e_1, e_m] = sbp.upwind4(m,h); | |
18 elseif order == 6 | |
19 [H, HI, Dp, Dm, e_1, e_m] = sbp.upwind6(m,h); | |
20 elseif order == 8 | |
21 [H, HI, Dp, Dm, e_1, e_m] = sbp.upwind8(m,h); | |
22 else | |
23 error('Invalid operator order %d.',order); | |
24 end | |
25 | |
26 obj.h = h; | |
27 obj.m = m; | |
28 | |
29 obj.norms.H = H; | |
30 obj.norms.HI = HI; | |
31 | |
32 obj.boundary.e_1 = e_1; | |
33 obj.boundary.e_m = e_m; | |
34 | |
35 obj.derivatives.Dp = Dp; | |
36 obj.derivatives.Dm = Dm; | |
37 end | |
38 end | |
39 | |
40 methods (Static) | |
41 function lambda = smallestGrid(obj) | |
42 error('Not implmented') | |
43 end | |
44 end | |
45 end | |
46 | |
47 | |
48 | |
49 | |
50 |