diff +time/SBPInTime.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 e1db62d14835
children 38173ea263ed b5e5b195da1e
line wrap: on
line diff
--- a/+time/SBPInTime.m	Thu Feb 02 14:46:36 2017 +0000
+++ b/+time/SBPInTime.m	Tue Feb 07 12:54:52 2017 +0000
@@ -24,9 +24,16 @@
 
     methods
         function obj = SBPInTime(A, f, k, t0, v0, TYPE, order, blockSize)
-            default_arg('TYPE','minimal');
-            default_arg('order', 8);
-            default_arg('blockSize',time.SBPInTime.smallestBlockSize(order,TYPE));
+
+            default_arg('TYPE','gauss');
+
+            if(strcmp(TYPE,'gauss'))
+                default_arg('order',4)
+                default_arg('blockSize',4)
+            else
+                default_arg('order', 8);
+                default_arg('blockSize',time.SBPInTime.smallestBlockSize(order,TYPE));
+            end
 
             obj.A = A;
             obj.f = f;
@@ -45,6 +52,8 @@
                     ops = sbp.D1Nonequidistant(blockSize,{0,obj.k},order);
                 case 'minimal'
                     ops = sbp.D1Nonequidistant(blockSize,{0,obj.k},order,'minimal');
+                case 'gauss'
+                    ops = sbp.D1Gauss(blockSize,{0,obj.k});
             end
 
             D1 = ops.D1;
@@ -76,7 +85,7 @@
 
             % Pretend that the initial condition is the last level
             % of a previous step.
-            obj.v = obj.Et_r * v0;
+            obj.v =  1/(e_r'*e_r) * obj.Et_r * v0;
 
         end
 
@@ -97,7 +106,7 @@
 
     methods(Static)
         function N = smallestBlockSize(order,TYPE)
-            default_arg('TYPE','equidistant')
+            default_arg('TYPE','gauss')
 
             switch TYPE
 
@@ -152,6 +161,8 @@
                         otherwise
                             error('Operator does not exist');
                     end
+                case 'gauss'
+                    N = 4;
             end
         end
     end