diff +scheme/Hypsyst2dCurve.m @ 1042:8d73fcdb07a5 feature/getBoundaryOp

Add asserts to boundary identifier inputs
author Jonatan Werpers <jonatan@werpers.com>
date Tue, 22 Jan 2019 16:47:34 +0100
parents 78db023a7fe3
children
line wrap: on
line diff
--- a/+scheme/Hypsyst2dCurve.m	Wed Jan 16 11:31:04 2019 -0800
+++ b/+scheme/Hypsyst2dCurve.m	Tue Jan 22 16:47:34 2019 +0100
@@ -376,6 +376,7 @@
         % op        -- string or a cell array of strings
         % boundary  -- string
         function varargout = getBoundaryOperator(obj, op, boundary)
+            assertIsMember(boundary, {'w', 'e', 's', 'n'})
 
             if ~iscell(op)
                 op = {op};
@@ -393,8 +394,6 @@
                         e = obj.e_s;
                     case 'n'
                         e = obj.e_n;
-                    otherwise
-                        error('No such boundary: boundary = %s',boundary);
                     end
                     varargout{i} = e;
                 end
@@ -406,6 +405,7 @@
         %
         % boundary -- string
         function H_b = getBoundaryQuadrature(obj, boundary)
+            assertIsMember(boundary, {'w', 'e', 's', 'n'})
 
             e = obj.getBoundaryOperator('e', boundary);
 
@@ -418,8 +418,6 @@
                     H_b = inv(e'*obj.Hxii*e);
                 case 'n'
                     H_b = inv(e'*obj.Hxii*e);
-                otherwise
-                    error('No such boundary: boundary = %s',boundary);
             end
         end