diff +scheme/Laplace1d.m @ 1045:dc1bcbef2a86 feature/getBoundaryOp

Remove ability to get several boundary ops at the same time from a few of the schemes While it can be handy the code for the getBoundaryOp methods get needlessly cluttered
author Jonatan Werpers <jonatan@werpers.com>
date Tue, 22 Jan 2019 17:12:22 +0100
parents 5afc774fb7c4
children 19ed046aec52
line wrap: on
line diff
--- a/+scheme/Laplace1d.m	Tue Jan 22 16:50:50 2019 +0100
+++ b/+scheme/Laplace1d.m	Tue Jan 22 17:12:22 2019 +0100
@@ -56,7 +56,8 @@
             default_arg('type','neumann');
             default_arg('data',0);
 
-            [e, d] = obj.getBoundaryOperator({'e', 'd'}, boundary);
+            e = obj.getBoundaryOperator('e', boundary);
+            d = obj.getBoundaryOperator('d', boundary);
             s = obj.getBoundarySign(boundary);
 
             switch type
@@ -114,17 +115,12 @@
         end
 
         % Returns the boundary operator op for the boundary specified by the string boundary.
-        % op        -- string or a cell array of strings
+        % op        -- string
         % boundary  -- string
-        function varargout = getBoundaryOperator(obj, op, boundary)
+        function o = getBoundaryOperator(obj, op, boundary)
             assertIsMember(boundary, {'l', 'r'})
 
-            if ~iscell(op)
-                op = {op};
-            end
-
-            for i = 1:numel(op)
-                switch op{i}
+            switch op
                 case 'e'
                     switch boundary
                     case 'l'
@@ -132,7 +128,7 @@
                     case 'r'
                         e = obj.e_r;
                     end
-                    varargout{i} = e;
+                    o = e;
 
                 case 'd'
                     switch boundary
@@ -141,8 +137,7 @@
                     case 'r'
                         d = obj.d_r;
                     end
-                    varargout{i} = d;
-                end
+                    o = d;
             end
         end