Mercurial > repos > public > sbplib
comparison +scheme/Hypsyst2dCurve.m @ 1042:8d73fcdb07a5 feature/getBoundaryOp
Add asserts to boundary identifier inputs
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Tue, 22 Jan 2019 16:47:34 +0100 |
parents | 78db023a7fe3 |
children |
comparison
equal
deleted
inserted
replaced
1007:9c8ed00732fd | 1042:8d73fcdb07a5 |
---|---|
374 | 374 |
375 % Returns the boundary operator op for the boundary specified by the string boundary. | 375 % Returns the boundary operator op for the boundary specified by the string boundary. |
376 % op -- string or a cell array of strings | 376 % op -- string or a cell array of strings |
377 % boundary -- string | 377 % boundary -- string |
378 function varargout = getBoundaryOperator(obj, op, boundary) | 378 function varargout = getBoundaryOperator(obj, op, boundary) |
379 assertIsMember(boundary, {'w', 'e', 's', 'n'}) | |
379 | 380 |
380 if ~iscell(op) | 381 if ~iscell(op) |
381 op = {op}; | 382 op = {op}; |
382 end | 383 end |
383 | 384 |
391 e = obj.e_e; | 392 e = obj.e_e; |
392 case 's' | 393 case 's' |
393 e = obj.e_s; | 394 e = obj.e_s; |
394 case 'n' | 395 case 'n' |
395 e = obj.e_n; | 396 e = obj.e_n; |
396 otherwise | |
397 error('No such boundary: boundary = %s',boundary); | |
398 end | 397 end |
399 varargout{i} = e; | 398 varargout{i} = e; |
400 end | 399 end |
401 end | 400 end |
402 end | 401 end |
404 % Returns square boundary quadrature matrix, of dimension | 403 % Returns square boundary quadrature matrix, of dimension |
405 % corresponding to the number of boundary points | 404 % corresponding to the number of boundary points |
406 % | 405 % |
407 % boundary -- string | 406 % boundary -- string |
408 function H_b = getBoundaryQuadrature(obj, boundary) | 407 function H_b = getBoundaryQuadrature(obj, boundary) |
408 assertIsMember(boundary, {'w', 'e', 's', 'n'}) | |
409 | 409 |
410 e = obj.getBoundaryOperator('e', boundary); | 410 e = obj.getBoundaryOperator('e', boundary); |
411 | 411 |
412 switch boundary | 412 switch boundary |
413 case 'w' | 413 case 'w' |
416 H_b = inv(e'*obj.Hetai*e); | 416 H_b = inv(e'*obj.Hetai*e); |
417 case 's' | 417 case 's' |
418 H_b = inv(e'*obj.Hxii*e); | 418 H_b = inv(e'*obj.Hxii*e); |
419 case 'n' | 419 case 'n' |
420 H_b = inv(e'*obj.Hxii*e); | 420 H_b = inv(e'*obj.Hxii*e); |
421 otherwise | |
422 error('No such boundary: boundary = %s',boundary); | |
423 end | 421 end |
424 end | 422 end |
425 | 423 |
426 | 424 |
427 end | 425 end |