Mercurial > repos > public > sbplib
diff +scheme/Wave2d.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 | 5afc774fb7c4 |
children |
line wrap: on
line diff
--- a/+scheme/Wave2d.m Fri Mar 29 14:50:50 2019 -0700 +++ b/+scheme/Wave2d.m Wed Apr 10 11:00:27 2019 -0700 @@ -200,6 +200,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}; @@ -217,8 +218,6 @@ e = obj.e_s; case 'n' e = obj.e_n; - otherwise - error('No such boundary: boundary = %s',boundary); end varargout{i} = e; @@ -232,8 +231,6 @@ d = obj.d1_s; case 'n' d = obj.d1_n; - otherwise - error('No such boundary: boundary = %s',boundary); end varargout{i} = d; end @@ -246,6 +243,7 @@ % % boundary -- string function H_b = getBoundaryQuadrature(obj, boundary) + assertIsMember(boundary, {'w', 'e', 's', 'n'}) switch boundary case 'w' @@ -256,39 +254,39 @@ H_b = obj.H_x; case 'n' H_b = obj.H_x; - otherwise - error('No such boundary: boundary = %s',boundary); end end % Returns borrowing constant gamma % boundary -- string function gamm = getBoundaryBorrowing(obj, boundary) + assertIsMember(boundary, {'w', 'e', 's', 'n'}) + switch boundary case {'w','e'} gamm = obj.gamm_x; case {'s','n'} gamm = obj.gamm_y; - 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 the halfnorm_inv used in SATs. TODO: better notation function Hinv = getHalfnormInv(obj, boundary) + assertIsMember(boundary, {'w', 'e', 's', 'n'}) + switch boundary case 'w' Hinv = obj.Hix; @@ -298,8 +296,6 @@ Hinv = obj.Hiy; case 'n' Hinv = obj.Hiy; - otherwise - error('No such boundary: boundary = %s',boundary); end end @@ -308,14 +304,4 @@ end end - - methods(Static) - % Calculates the matrcis need for the inteface coupling between boundary bound_u of scheme schm_u - % and bound_v of scheme schm_v. - % [uu, uv, vv, vu] = inteface_couplong(A,'r',B,'l') - function [uu, uv, vv, vu] = interface_coupling(schm_u,bound_u,schm_v,bound_v) - [uu,uv] = schm_u.interface(bound_u,schm_v,bound_v); - [vv,vu] = schm_v.interface(bound_v,schm_u,bound_u); - end - end -end \ No newline at end of file +end