comparison +scheme/Laplace1d.m @ 1046:19ed046aec52 feature/getBoundaryOp

Clean up getBoundaryOps for a few schemes
author Jonatan Werpers <jonatan@werpers.com>
date Tue, 22 Jan 2019 17:37:07 +0100
parents dc1bcbef2a86
children 6bc55a773e7c
comparison
equal deleted inserted replaced
1045:dc1bcbef2a86 1046:19ed046aec52
116 116
117 % Returns the boundary operator op for the boundary specified by the string boundary. 117 % Returns the boundary operator op for the boundary specified by the string boundary.
118 % op -- string 118 % op -- string
119 % boundary -- string 119 % boundary -- string
120 function o = getBoundaryOperator(obj, op, boundary) 120 function o = getBoundaryOperator(obj, op, boundary)
121 assertIsMember(op, {'e', 'd'})
121 assertIsMember(boundary, {'l', 'r'}) 122 assertIsMember(boundary, {'l', 'r'})
122 123
123 switch op 124 o = obj.([op, '_', boundary])
124 case 'e'
125 switch boundary
126 case 'l'
127 e = obj.e_l;
128 case 'r'
129 e = obj.e_r;
130 end
131 o = e;
132
133 case 'd'
134 switch boundary
135 case 'l'
136 d = obj.d_l;
137 case 'r'
138 d = obj.d_r;
139 end
140 o = d;
141 end
142 end 125 end
143 126
144 % Returns the boundary sign. The right boundary is considered the positive boundary 127 % Returns the boundary sign. The right boundary is considered the positive boundary
145 % boundary -- string 128 % boundary -- string
146 function s = getBoundarySign(obj, boundary) 129 function s = getBoundarySign(obj, boundary)