diff +scheme/Beam.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 2b1b944deae1
children 5afc774fb7c4
line wrap: on
line diff
--- a/+scheme/Beam.m	Wed Jan 16 11:31:04 2019 -0800
+++ b/+scheme/Beam.m	Tue Jan 22 16:47:34 2019 +0100
@@ -240,10 +240,7 @@
         % op        -- string or a cell array of strings
         % boundary  -- string
         function varargout = getBoundaryOperator(obj, op, boundary)
-
-            if ~ismember(boundary, {'l', 'r'})
-                error('No such boundary: boundary = %s',boundary);
-            end
+            assertIsMember(boundary, {'l', 'r'})
 
             if ~iscell(op)
                 op = {op};
@@ -295,13 +292,13 @@
         % Returns the boundary sign. The right boundary is considered the positive boundary
         % boundary -- string
         function s = getBoundarySign(obj, boundary)
+            assertIsMember(boundary, {'l', 'r'})
+
             switch boundary
                 case {'r'}
                     s = 1;
                 case {'l'}
                     s = -1;
-                otherwise
-                    error('No such boundary: boundary = %s',boundary);
             end
         end