diff +sbp/+implementations/d1_upwind_2.m @ 266:bfa130b7abf6 operator_remake

Added error message for too few grid points to all implementation files.
author Martin Almquist <martin.almquist@it.uu.se>
date Fri, 09 Sep 2016 11:03:13 +0200
parents 6009f2712d13
children f7ac3cd6eeaa
line wrap: on
line diff
--- a/+sbp/+implementations/d1_upwind_2.m	Fri Sep 09 10:41:31 2016 +0200
+++ b/+sbp/+implementations/d1_upwind_2.m	Fri Sep 09 11:03:13 2016 +0200
@@ -1,4 +1,9 @@
 function [H, HI, Dp, Dm, e_1, e_m] = d1_upwind_2(m,h)
+    
+    if(m<4)
+        error('Operator requires at least 4 grid points');
+    end
+
     Hv=ones(m,1);
     Hv(1:2)=[0.1e1/0.4e1; 0.5e1/0.4e1;];
     Hv(m-1:m)=rot90(Hv(1:2),2);