Mercurial > repos > public > sbplib
diff +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 |
line wrap: on
line diff
--- a/+scheme/Laplace1d.m Tue Jan 22 17:12:22 2019 +0100 +++ b/+scheme/Laplace1d.m Tue Jan 22 17:37:07 2019 +0100 @@ -118,27 +118,10 @@ % op -- string % boundary -- string function o = getBoundaryOperator(obj, op, boundary) + assertIsMember(op, {'e', 'd'}) assertIsMember(boundary, {'l', 'r'}) - switch op - case 'e' - switch boundary - case 'l' - e = obj.e_l; - case 'r' - e = obj.e_r; - end - o = e; - - case 'd' - switch boundary - case 'l' - d = obj.d_l; - case 'r' - d = obj.d_r; - end - o = d; - end + o = obj.([op, '_', boundary]) end % Returns the boundary sign. The right boundary is considered the positive boundary