comparison +scheme/Utux.m @ 998:2b1b944deae1 feature/getBoundaryOp

Add getBoundaryOperator to all 1d schemes. Did not add getBoundaryQuadrature because it doesnt make sense in 1d (?)
author Martin Almquist <malmquist@stanford.edu>
date Sat, 12 Jan 2019 13:35:19 -0800
parents 6d2167719557
children 8d73fcdb07a5
comparison
equal deleted inserted replaced
997:78db023a7fe3 998:2b1b944deae1
70 penalty = -obj.Hi*tau*neighbour_scheme.e_l'; 70 penalty = -obj.Hi*tau*neighbour_scheme.e_l';
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.
76 % op -- string or a cell array of strings
77 % boundary -- string
78 function varargout = getBoundaryOperator(obj, op, boundary)
79
80 if ~iscell(op)
81 op = {op};
82 end
83
84 for i = 1:numel(op)
85 switch op{i}
86 case 'e'
87 switch boundary
88 case 'l'
89 e = obj.e_l;
90 case 'r'
91 e = obj.e_r;
92 otherwise
93 error('No such boundary: boundary = %s',boundary);
94 end
95 varargout{i} = e;
96 end
97 end
98 end
99
75 function N = size(obj) 100 function N = size(obj)
76 N = obj.m; 101 N = obj.m;
77 end 102 end
78 103
79 end 104 end