Mercurial > repos > public > sbplib
comparison +scheme/Utux.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 | 0c504a21432d |
children | 433c89bf19e0 |
comparison
equal
deleted
inserted
replaced
1087:867307f4d80f | 1108:5ec23b9bf360 |
---|---|
71 end | 71 end |
72 | 72 |
73 end | 73 end |
74 | 74 |
75 % Returns the boundary operator op for the boundary specified by the string boundary. | 75 % Returns the boundary operator op for the boundary specified by the string boundary. |
76 % op -- string or a cell array of strings | 76 % op -- string |
77 % boundary -- string | 77 % boundary -- string |
78 function varargout = getBoundaryOperator(obj, op, boundary) | 78 function o = getBoundaryOperator(obj, op, boundary) |
79 assertIsMember(op, {'e'}) | |
80 assertIsMember(boundary, {'l', 'r'}) | |
79 | 81 |
80 if ~iscell(op) | 82 o = obj.([op, '_', boundary]); |
81 op = {op}; | 83 end |
82 end | |
83 | 84 |
84 for i = 1:numel(op) | 85 % Returns square boundary quadrature matrix, of dimension |
85 switch op{i} | 86 % corresponding to the number of boundary points |
86 case 'e' | 87 % |
87 switch boundary | 88 % boundary -- string |
88 case 'l' | 89 % Note: for 1d diffOps, the boundary quadrature is the scalar 1. |
89 e = obj.e_l; | 90 function H_b = getBoundaryQuadrature(obj, boundary) |
90 case 'r' | 91 assertIsMember(boundary, {'l', 'r'}) |
91 e = obj.e_r; | 92 |
92 otherwise | 93 H_b = 1; |
93 error('No such boundary: boundary = %s',boundary); | |
94 end | |
95 varargout{i} = e; | |
96 end | |
97 end | |
98 end | 94 end |
99 | 95 |
100 function N = size(obj) | 96 function N = size(obj) |
101 N = obj.m; | 97 N = obj.m; |
102 end | 98 end |
103 | 99 |
104 end | 100 end |
105 | |
106 methods(Static) | |
107 % Calculates the matrices needed for the inteface coupling between boundary bound_u of scheme schm_u | |
108 % and bound_v of scheme schm_v. | |
109 % [uu, uv, vv, vu] = inteface_coupling(A,'r',B,'l') | |
110 function [uu, uv, vv, vu] = interface_coupling(schm_u,bound_u,schm_v,bound_v) | |
111 [uu,uv] = schm_u.interface(bound_u,schm_v,bound_v); | |
112 [vv,vu] = schm_v.interface(bound_v,schm_u,bound_u); | |
113 end | |
114 end | |
115 end | 101 end |