Mercurial > repos > public > sbplib
diff +scheme/Heat2dCurvilinear.m @ 1108:5ec23b9bf360 feature/laplace_curvilinear_test
Merge with default
author | Martin Almquist <malmquist@stanford.edu> |
---|---|
date | Wed, 10 Apr 2019 11:00:27 -0700 |
parents | 8d73fcdb07a5 |
children |
line wrap: on
line diff
--- a/+scheme/Heat2dCurvilinear.m Fri Mar 29 14:50:50 2019 -0700 +++ b/+scheme/Heat2dCurvilinear.m Wed Apr 10 11:00:27 2019 -0700 @@ -321,6 +321,7 @@ % op -- string or a cell array of strings % boundary -- string function varargout = getBoundaryOperator(obj, op, boundary) + assertIsMember(boundary, {'w', 'e', 's', 'n'}) if ~iscell(op) op = {op}; @@ -338,8 +339,6 @@ e = obj.e_l{2}; case 'n' e = obj.e_r{2}; - otherwise - error('No such boundary: boundary = %s',boundary); end varargout{i} = e; @@ -353,8 +352,6 @@ d = obj.d1_l{2}; case 'n' d = obj.d1_r{2}; - otherwise - error('No such boundary: boundary = %s',boundary); end varargout{i} = d; @@ -368,8 +365,6 @@ flux = obj.flux_l{2}; case 'n' flux = obj.flux_r{2}; - otherwise - error('No such boundary: boundary = %s',boundary); end varargout{i} = flux; end @@ -381,6 +376,7 @@ % % boundary -- string function H_b = getBoundaryQuadrature(obj, boundary) + assertIsMember(boundary, {'w', 'e', 's', 'n'}) switch boundary case 'w' @@ -391,34 +387,32 @@ H_b = obj.H_boundary_l{2}; case 'n' H_b = obj.H_boundary_r{2}; - otherwise - error('No such boundary: boundary = %s',boundary); end end % Returns the boundary sign. The right boundary is considered the positive boundary % boundary -- string function s = getBoundarySign(obj, boundary) + assertIsMember(boundary, {'w', 'e', 's', 'n'}) + switch boundary case {'e','n'} s = 1; case {'w','s'} s = -1; - otherwise - error('No such boundary: boundary = %s',boundary); end end % Returns borrowing constant gamma*h % boundary -- string function gamm = getBoundaryBorrowing(obj, boundary) + assertIsMember(boundary, {'w', 'e', 's', 'n'}) + switch boundary case {'w','e'} gamm = obj.h(1)*obj.alpha(1); case {'s','n'} gamm = obj.h(2)*obj.alpha(2); - otherwise - error('No such boundary: boundary = %s',boundary); end end