comparison +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
comparison
equal deleted inserted replaced
1047:6bc55a773e7c 1048:adbb80e60b10
71 end 71 end
72 72
73 end 73 end
74 74
75 % Returns the boundary operator op for the boundary specified by the string boundary. 75 % Returns the boundary operator op for the boundary specified by the string boundary.
76 % op -- string or a cell array of strings 76 % op -- string
77 % boundary -- string 77 % boundary -- string
78 function varargout = getBoundaryOperator(obj, op, boundary) 78 function o = getBoundaryOperator(obj, op, boundary)
79 assertIsMember(op, {'e'})
79 assertIsMember(boundary, {'l', 'r'}) 80 assertIsMember(boundary, {'l', 'r'})
80 81
81 if ~iscell(op) 82 o = obj.([op, '_', boundary]);
82 op = {op};
83 end
84
85 for i = 1:numel(op)
86 switch op{i}
87 case 'e'
88 switch boundary
89 case 'l'
90 e = obj.e_l;
91 case 'r'
92 e = obj.e_r;
93 end
94 varargout{i} = e;
95 end
96 end
97 end 83 end
98 84
99 function N = size(obj) 85 function N = size(obj)
100 N = obj.m; 86 N = obj.m;
101 end 87 end