comparison +sbp/D1Gauss.m @ 431:5f4540e13f9b feature/quantumTriangles

Meged with default
author Ylva Rydin <ylva.rydin@telia.com>
date Wed, 08 Feb 2017 09:18:08 +0100
parents 42c4f0b545d6
children e1d11b6a68d8
comparison
equal deleted inserted replaced
430:25053554524b 431:5f4540e13f9b
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