Mercurial > repos > public > sbplib
comparison +sbp/D1Gauss.m @ 411:16a76db8c279
Merged in feature/SBPInTimeGauss (pull request #6)
Feature/sbpintimegauss
author | Jonatan Werpers <jonatan.werpers@it.uu.se> |
---|---|
date | Tue, 07 Feb 2017 12:54:52 +0000 |
parents | 42c4f0b545d6 |
children | e1d11b6a68d8 |
comparison
equal
deleted
inserted
replaced
404:d6d27fdc342a | 411:16a76db8c279 |
---|---|
1 classdef D1Gauss < sbp.OpSet | |
2 % Diagonal-norm SBP operators based on the Gauss quadrature formula | |
3 % with m nodes, which is of degree 2m-1. Hence, The operator D1 is | |
4 % accurate of order m. | |
5 properties | |
6 D1 % SBP operator approximating first derivative | |
7 H % Norm matrix | |
8 HI % H^-1 | |
9 Q % Skew-symmetric matrix | |
10 e_l % Left boundary operator | |
11 e_r % Right boundary operator | |
12 m % Number of grid points. | |
13 h % Step size | |
14 x % grid | |
15 borrowing % Struct with borrowing limits for different norm matrices | |
16 end | |
17 | |
18 methods | |
19 function obj = D1Gauss(m,lim) | |
20 | |
21 x_l = lim{1}; | |
22 x_r = lim{2}; | |
23 L = x_r-x_l; | |
24 | |
25 switch m | |
26 case 4 | |
27 [obj.D1,obj.H,obj.x,obj.h,obj.e_l,obj.e_r] = ... | |
28 sbp.implementations.d1_gauss_4(L); | |
29 otherwise | |
30 error('Invalid number of points: %d.', m); | |
31 end | |
32 | |
33 | |
34 obj.x = obj.x + x_l; | |
35 obj.HI = inv(obj.H); | |
36 obj.Q = obj.H*obj.D1 - obj.e_r*obj.e_r' + obj.e_l*obj.e_l'; | |
37 | |
38 obj.borrowing = []; | |
39 end | |
40 end | |
41 end |