comparison +scheme/Utux.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
comparison
equal deleted inserted replaced
1007:9c8ed00732fd 1042:8d73fcdb07a5
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 or a cell array of strings
77 % boundary -- string 77 % boundary -- string
78 function varargout = getBoundaryOperator(obj, op, boundary) 78 function varargout = getBoundaryOperator(obj, op, boundary)
79 assertIsMember(boundary, {'l', 'r'})
79 80
80 if ~iscell(op) 81 if ~iscell(op)
81 op = {op}; 82 op = {op};
82 end 83 end
83 84
87 switch boundary 88 switch boundary
88 case 'l' 89 case 'l'
89 e = obj.e_l; 90 e = obj.e_l;
90 case 'r' 91 case 'r'
91 e = obj.e_r; 92 e = obj.e_r;
92 otherwise
93 error('No such boundary: boundary = %s',boundary);
94 end 93 end
95 varargout{i} = e; 94 varargout{i} = e;
96 end 95 end
97 end 96 end
98 end 97 end