changeset 308:067fd13ba320 feature/beams

Improved form of D4CompatibleVariable.
author Jonatan Werpers <jonatan@werpers.com>
date Fri, 23 Sep 2016 10:51:37 +0200
parents fefb2f9884f7
children 8fafe97bf27b
files +sbp/D4CompatibleVariable.m
diffstat 1 files changed, 47 insertions(+), 38 deletions(-) [+]
line wrap: on
line diff
diff -r fefb2f9884f7 -r 067fd13ba320 +sbp/D4CompatibleVariable.m
--- a/+sbp/D4CompatibleVariable.m	Fri Sep 23 10:40:12 2016 +0200
+++ b/+sbp/D4CompatibleVariable.m	Fri Sep 23 10:51:37 2016 +0200
@@ -1,31 +1,29 @@
 classdef D4CompatibleVariable < sbp.OpSet
     properties
-        D1 % SBP operator approximating first derivative
-        H % Norm matrix
-        HI % H^-1
-        Q % Skew-symmetric matrix
-        e_l % Left boundary operator
-        e_r % Right boundary operator
-        D2 % SBP operator for second derivative
-        M % Norm matrix, second derivative
+        D1   % SBP operator approximating first derivative
+        H    % Norm matrix
+        HI   % H^-1
+        Q    % Skew-symmetric matrix
+        e_l  % Left boundary operator
+        e_r  % Right boundary operator
+        D2   % SBP operator for second derivative
+        M    % Norm matrix, second derivative
         d1_l % Left boundary first derivative
         d1_r % Right boundary first derivative
-        D3 % SBP operator for third derivative
-        Q3 % Skew-symmetric matrix in third derivative
+        D3   % SBP operator for third derivative
+        Q3   % Skew-symmetric matrix in third derivative
         d2_l % Left boundary second derivative
         d2_r % Right boundary second derivative
-        D4 % SBP operator for fourth derivative
-        M4 % Norm matrix, fourth derivative
+        D4   % SBP operator for fourth derivative
+        M4   % Norm matrix, fourth derivative
         d3_l % Left boundary third derivative
         d3_r % Right boundary third derivative
-        m % Number of grid points.
-        h % Step size
-        x % grid
+        m    % Number of grid points.
+        h    % Step size
+        x    % grid
         borrowing % Struct with borrowing limits for different norm matrices
     end
 
-
-
     methods
         function obj = D4CompatibleVariable(m, lim, order, opt)
             default_arg('opt', '')
@@ -43,53 +41,55 @@
                     sbp.implementations.d4_compatible_halfvariable_2(m,obj.h);
                 obj.borrowing.N.S2 = 1.2500;
                 obj.borrowing.N.S3 = 0.4000;
+
             elseif order == 4
                 switch opt
                     case 'min_boundary_points'
-                        [H, HI, D2, D4, e_1, e_m, M4, S2_1, S2_m, S3_1, S3_m, S_1, S_m] = sbp.higher_variable4_min_boundary_points(m,h);
+                        [H, HI, D2, D4, e_l, e_r, M4, d2_l, d2_r, d3_l, d3_r, d1_l, d1_r] = ...
+                            sbp.higher_variable4_min_boundary_points(m, obj.h);
                         % obj.borrowing.N.S2 = 0.5055;
                         % obj.borrowing.N.S3 = 0.9290;
                     otherwise
-                        [obj.H, obj.HI, obj.D2, obj.D4, obj.e_l, obj.e_r, obj.M4,...
-                         obj.d2_l, obj.d2_r, obj.d3_l, obj.d3_r, obj.d1_l,...
-                            obj.d1_r] =...
-                            sbp.implementations.d4_compatible_halfvariable_4(m,obj.h);
+                        [H, HI, D2, D4, e_l, e_r, M4, d2_l, d2_r, d3_l, d3_r, d1_l, d1_r] = ...
+                            sbp.implementations.d4_compatible_halfvariable_4(m, obj.h);
                         obj.borrowing.N.S2 = 0.5055;
                         obj.borrowing.N.S3 = 0.9290;
                 end
 
             elseif order == 6
-
-
                 switch opt
                     case '2'
-                        [H, HI, D2, D4, e_1, e_m, M4, S2_1, S2_m, S3_1, S3_m, S_1, S_m] = sbp.higher_variable6_2(m,h);
+                        [H, HI, D2, D4, e_l, e_r, M4, d2_l, d2_r, d3_l, d3_r, d1_l, d1_r] = ...
+                            sbp.higher_variable6_2(m, obj.h);
                         % obj.borrowing.N.S2 = 0.3259;
                         % obj.borrowing.N.S3 = 0.1580;
                     case '3'
-                        [H, HI, D2, D4, e_1, e_m, M4, S2_1, S2_m, S3_1, S3_m, S_1, S_m] = sbp.higher_variable6_3(m,h);
+                        [H, HI, D2, D4, e_l, e_r, M4, d2_l, d2_r, d3_l, d3_r, d1_l, d1_r] = ...
+                            sbp.higher_variable6_3(m, obj.h);
                         % obj.borrowing.N.S2 = 0.3259;
                         % obj.borrowing.N.S3 = 0.1580;
                     case 'min_boundary_points'
-                        [H, HI, D2, D4, e_1, e_m, M4, S2_1, S2_m, S3_1, S3_m, S_1, S_m] = sbp.higher_variable6_min_boundary_points(m,h);
+                        [H, HI, D2, D4, e_l, e_r, M4, d2_l, d2_r, d3_l, d3_r, d1_l, d1_r] = ...
+                            sbp.higher_variable6_min_boundary_points(m, obj.h);
                         % obj.borrowing.N.S2 = 0.3259;
                         % obj.borrowing.N.S3 = 0.1580;
                     otherwise
-                        [obj.H, obj.HI, obj.D2, obj.D4, obj.e_l, obj.e_r, obj.M4,...
-                         obj.d2_l, obj.d2_r, obj.d3_l, obj.d3_r, obj.d1_l,...
-                            obj.d1_r] =...
-                            sbp.implementations.d4_compatible_halfvariable_6(m,obj.h);
+                        [H, HI, D2, D4, e_l, e_r, M4, d2_l, d2_r, d3_l, d3_r, d1_l, d1_r] = ...
+                            sbp.implementations.d4_compatible_halfvariable_6(m, obj.h);
                         obj.borrowing.N.S2 = 0.3259;
                         obj.borrowing.N.S3 = 0.1580;
                 end
+
             elseif order == 8
                 switch opt
                     case 'min_boundary_points'
-                        [H, HI, D2, D4, e_1, e_m, M4, S2_1, S2_m, S3_1, S3_m, S_1, S_m] = sbp.higher_variable8_min_boundary_points(m,h);
+                        [H, HI, D2, D4, e_l, e_r, M4, d2_l, d2_r, d3_l, d3_r, d1_l, d1_r] = ...
+                            sbp.higher_variable8_min_boundary_points(m, obj.h);
                         % obj.borrowing.N.S2 = 0.3259;
                         % obj.borrowing.N.S3 = 0.1580;
                     otherwise
-                        [H, HI, D2, D4, e_1, e_m, M4, S2_1, S2_m, S3_1, S3_m, S_1, S_m] = sbp.higher_variable8_higher_boundary_order(m,h);
+                        [H, HI, D2, D4, e_l, e_r, M4, d2_l, d2_r, d3_l, d3_r, d1_l, d1_r] = ...
+                            sbp.higher_variable8_higher_boundary_order(m, obj.h);
                         % obj.borrowing.N.S2 = 0.3259;
                         % obj.borrowing.N.S3 = 0.1580;
                     end
@@ -99,13 +99,22 @@
 
             obj.m = m;
 
+            obj.H    = H;
+            obj.HI   = HI;
+            obj.D2   = D2;
+            obj.D4   = D4;
+            obj.M4   = M4;
+            obj.e_l  = e_l;
+            obj.e_r  = e_r;
+            obj.d1_l = d1_l;
+            obj.d1_r = d1_r ;
+            obj.d2_l = d2_l;
+            obj.d2_r = d2_r;
+            obj.d3_l = d3_l;
+            obj.d3_r = d3_r;
+
             obj.D1 = [];
             obj.D3 = [];
-
-
         end
     end
-
-
-
 end
\ No newline at end of file