diff +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
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/+sbp/D4Standard.m	Thu Sep 08 17:50:30 2016 +0200
@@ -0,0 +1,59 @@
+classdef D4Standard < sbp.OpSet
+    properties
+        D1 % SBP operator approximating first derivative
+        H % Norm matrix
+        HI % H^-1
+        Q % Skew-symmetric matrix
+        e_1 % Left boundary operator
+        e_m % Right boundary operator
+        D2 % SBP operator for second derivative
+        M % Norm matrix, second derivative
+        S_1 % Left boundary first derivative
+        S_m % Right boundary first derivative
+        D3 % SBP operator for third derivative
+        Q3 % Skew-symmetric matrix in third derivative
+        S2_1 % Left boundary second derivative
+        S2_m % Right boundary second derivative
+        D4 % SBP operator for fourth derivative
+        M4 % Norm matrix, fourth derivative
+        S3_1 % Left boundary third derivative
+        S3_m % Right boundary third derivative
+        m % Number of grid points.
+        h % Step size
+        x % grid
+        borrowing % Struct with borrowing limits for different norm matrices
+    end
+
+
+
+    methods
+        function obj = D4Standard(m,L,order)
+            
+            obj.h = L/(m-1);
+            obj.x = linspace(0,L,m)';
+
+            if order == 4
+                [obj.H, obj.HI, obj.D1, obj.D2, obj.D3, obj.D4,...
+                 obj.e_1, obj.e_m, obj.M, obj.M4, obj.Q, obj.Q3, obj.S2_1,...
+                 obj.S2_m, obj.S3_1, obj.S3_m, obj.S_1, obj.S_m] = ...
+                  sbp.implementations.d4_4(m,obj.h);
+                obj.borrowing.N.S2 = 0.5485;
+                obj.borrowing.N.S3 = 1.0882;
+            elseif order == 6
+                [obj.H, obj.HI, obj.D1, obj.D2, obj.D3, obj.D4,...
+                 obj.e_1, obj.e_m, obj.M, obj.M4, obj.Q, obj.Q3, obj.S2_1,...
+                 obj.S2_m, obj.S3_1, obj.S3_m, obj.S_1, obj.S_m] = ...
+                  sbp.implementations.d4_6(m,obj.h);
+                obj.borrowing.N.S2 = 0.3227;
+                obj.borrowing.N.S3 = 0.1568;
+            else
+                error('Invalid operator order %d.',order);
+            end
+
+            obj.m = m;
+
+        end
+    end
+
+
+end
\ No newline at end of file