diff +scheme/Utux.m @ 1062:e512714fb890 feature/laplace_curvilinear_test

Merge with feature/getBoundaryOp
author Martin Almquist <malmquist@stanford.edu>
date Mon, 14 Jan 2019 18:14:44 -0800
parents 2b1b944deae1
children 8d73fcdb07a5
line wrap: on
line diff
--- a/+scheme/Utux.m	Tue Jan 08 15:00:12 2019 +0100
+++ b/+scheme/Utux.m	Mon Jan 14 18:14:44 2019 -0800
@@ -72,6 +72,31 @@
 
          end
 
+        % Returns the boundary operator op for the boundary specified by the string boundary.
+        % op        -- string or a cell array of strings
+        % boundary  -- string
+        function varargout = getBoundaryOperator(obj, op, boundary)
+
+            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;
+                    otherwise
+                        error('No such boundary: boundary = %s',boundary);
+                    end
+                    varargout{i} = e;
+                end
+            end
+        end
+
         function N = size(obj)
             N = obj.m;
         end