diff +scheme/Utux.m @ 1048:adbb80e60b10 feature/getBoundaryOp

Clean up Elastic2dVariable (partially), Utux, and Utux2d.
author Martin Almquist <malmquist@stanford.edu>
date Tue, 22 Jan 2019 11:12:23 -0800
parents 5afc774fb7c4
children 0c504a21432d
line wrap: on
line diff
--- a/+scheme/Utux.m	Tue Jan 22 17:42:58 2019 +0100
+++ b/+scheme/Utux.m	Tue Jan 22 11:12:23 2019 -0800
@@ -73,27 +73,13 @@
          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(op, {'e'})
             assertIsMember(boundary, {'l', 'r'})
 
-            if ~iscell(op)
-                op = {op};
-            end
-
-            for i = 1:numel(op)
-                switch op{i}
-                case 'e'
-                    switch boundary
-                    case 'l'
-                        e = obj.e_l;
-                    case 'r'
-                        e = obj.e_r;
-                    end
-                    varargout{i} = e;
-                end
-            end
+            o = obj.([op, '_', boundary]);
         end
 
         function N = size(obj)