comparison +sbp/D4Standard.m @ 263:21a180acbd49 operator_remake

Renamed standard class to D2Standard etc, Rewrote class properties.
author Martin Almquist <martin.almquist@it.uu.se>
date Thu, 08 Sep 2016 17:50:30 +0200
parents
children 8a625c5a3633
comparison
equal deleted inserted replaced
262:23051a86faa4 263:21a180acbd49
1 classdef D4Standard < sbp.OpSet
2 properties
3 D1 % SBP operator approximating first derivative
4 H % Norm matrix
5 HI % H^-1
6 Q % Skew-symmetric matrix
7 e_1 % Left boundary operator
8 e_m % Right boundary operator
9 D2 % SBP operator for second derivative
10 M % Norm matrix, second derivative
11 S_1 % Left boundary first derivative
12 S_m % Right boundary first derivative
13 D3 % SBP operator for third derivative
14 Q3 % Skew-symmetric matrix in third derivative
15 S2_1 % Left boundary second derivative
16 S2_m % Right boundary second derivative
17 D4 % SBP operator for fourth derivative
18 M4 % Norm matrix, fourth derivative
19 S3_1 % Left boundary third derivative
20 S3_m % Right boundary third derivative
21 m % Number of grid points.
22 h % Step size
23 x % grid
24 borrowing % Struct with borrowing limits for different norm matrices
25 end
26
27
28
29 methods
30 function obj = D4Standard(m,L,order)
31
32 obj.h = L/(m-1);
33 obj.x = linspace(0,L,m)';
34
35 if order == 4
36 [obj.H, obj.HI, obj.D1, obj.D2, obj.D3, obj.D4,...
37 obj.e_1, obj.e_m, obj.M, obj.M4, obj.Q, obj.Q3, obj.S2_1,...
38 obj.S2_m, obj.S3_1, obj.S3_m, obj.S_1, obj.S_m] = ...
39 sbp.implementations.d4_4(m,obj.h);
40 obj.borrowing.N.S2 = 0.5485;
41 obj.borrowing.N.S3 = 1.0882;
42 elseif order == 6
43 [obj.H, obj.HI, obj.D1, obj.D2, obj.D3, obj.D4,...
44 obj.e_1, obj.e_m, obj.M, obj.M4, obj.Q, obj.Q3, obj.S2_1,...
45 obj.S2_m, obj.S3_1, obj.S3_m, obj.S_1, obj.S_m] = ...
46 sbp.implementations.d4_6(m,obj.h);
47 obj.borrowing.N.S2 = 0.3227;
48 obj.borrowing.N.S3 = 0.1568;
49 else
50 error('Invalid operator order %d.',order);
51 end
52
53 obj.m = m;
54
55 end
56 end
57
58
59 end