Mercurial > repos > public > sbplib
comparison +scheme/LaplaceCurvilinear.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 |
---|---|
399 | 399 |
400 % Returns the boundary operator op for the boundary specified by the string boundary. | 400 % Returns the boundary operator op for the boundary specified by the string boundary. |
401 % op -- string | 401 % op -- string |
402 % boundary -- string | 402 % boundary -- string |
403 function o = getBoundaryOperator(obj, op, boundary) | 403 function o = getBoundaryOperator(obj, op, boundary) |
404 assertIsMember(op, {'e', 'd'}) | |
404 assertIsMember(boundary, {'w', 'e', 's', 'n'}) | 405 assertIsMember(boundary, {'w', 'e', 's', 'n'}) |
405 | 406 |
406 switch op | 407 o = obj.([op, '_', boundary]); |
407 case 'e' | |
408 switch boundary | |
409 case 'w' | |
410 e = obj.e_w; | |
411 case 'e' | |
412 e = obj.e_e; | |
413 case 's' | |
414 e = obj.e_s; | |
415 case 'n' | |
416 e = obj.e_n; | |
417 end | |
418 o = e; | |
419 | |
420 case 'd' | |
421 switch boundary | |
422 case 'w' | |
423 d = obj.d_w; | |
424 case 'e' | |
425 d = obj.d_e; | |
426 case 's' | |
427 d = obj.d_s; | |
428 case 'n' | |
429 d = obj.d_n; | |
430 end | |
431 o = d; | |
432 end | |
433 end | 408 end |
434 | 409 |
435 % Returns square boundary quadrature matrix, of dimension | 410 % Returns square boundary quadrature matrix, of dimension |
436 % corresponding to the number of boundary points | 411 % corresponding to the number of boundary points |
437 % | 412 % |
438 % boundary -- string | 413 % boundary -- string |
439 function H_b = getBoundaryQuadrature(obj, boundary) | 414 function H_b = getBoundaryQuadrature(obj, boundary) |
440 assertIsMember(boundary, {'w', 'e', 's', 'n'}) | 415 assertIsMember(boundary, {'w', 'e', 's', 'n'}) |
441 | 416 |
442 switch boundary | 417 H_b = obj.('H_', boundary); |
443 case 'w' | |
444 H_b = obj.H_w; | |
445 case 'e' | |
446 H_b = obj.H_e; | |
447 case 's' | |
448 H_b = obj.H_s; | |
449 case 'n' | |
450 H_b = obj.H_n; | |
451 end | |
452 end | 418 end |
453 | 419 |
454 % Returns the indices of the boundary points in the grid matrix | 420 % Returns the indices of the boundary points in the grid matrix |
455 % boundary -- string | 421 % boundary -- string |
456 function I = getBoundaryIndices(obj, boundary) | 422 function I = getBoundaryIndices(obj, boundary) |